'version' returned by 'fileparts' is apparently always an empty string

Sergei Steshenko sergstesh at yahoo.com
Thu Jan 1 18:00:37 CST 2009


Hello,

I came to the conclusion written in the subject observing source code of
'fileparts' - IMO the only place 'version' gets value is line #43:

     26 function [directory, name, extension, version] = fileparts (filename)
     27
     28   if (nargin == 1)
     29     if (ischar (filename))
     30       ds = rindex (filename, filesep);
     31       es = rindex (filename, ".");
     32       ## These can be the same if they are both 0 (no dir or ext).
     33       if (es <= ds)
     34         es = length(filename)+1;
     35       endif
     36       directory = filename(1:ds-1);
     37       name = filename(ds+1:es-1);
     38       if (es > 0)
     39         extension = filename(es:end);
     40       else
     41         extension = "";
     42       endif
     43       version = "";
     44     else
     45       error ("fileparts: expecting filename argument to be a string");
     46     endif
     47   else
     48     print_usage ();
     49   endif
     50
     51 endfunction
.

The file is:

octave-3.0.3/share/octave/3.0.3/m/miscellaneous/fileparts.m
.

Thanks,
  Sergei.


      


More information about the Bug-octave mailing list