BUG DESCRIPTION:
----------------
When we want to retrieve the path and filename of one or all opened files with
[fid,typ,pathnames] = file() or [fid,typ,pathnames] = file(fid)
returned paths of pathnames are now relative to the directory that was current when opening the file(s).
Up to Scilab 5.5.2, paths were absolute.
Retrieving paths relative to the directory that was current when opening the files is meaningless and useless.
Indeed, the current directory may often have changed in the meanwhile, while since 6.0.0 returned pathnames are not updated accordingly.
Switching from absolute to relative paths could be defensible.
Returning outdated relative paths is just wrong.
In Scilab 5.5.2:
-->pwd
ans =
C:\Users\me\Scilab\_tests
-->fid = file("open","bug.txt","old");
-->[units, typ, nams] = file(fid); nams
nams =
C:\Users\me\Scilab\_tests\bug.txt // <<<< Absolute path : OK
-->file("close",fid)
In Scilab 6.0.0 (and still in 6.1.1):
----------------
--> pwd
ans =
C:\Users\me\Scilab\_tests
--> fid = file("open","bug.txt","old");
--> [units, typ, nams] = file(fid); nams
nams =
bug.txt // <<<< Relative path : why not... BUT :
--> cd ..; pwd
ans =
C:\Users\me\Scilab
--> [units, typ, nams] = file(fid); nams
nams =
bug.txt // <<<< OUTDATED relative = WRONG unusable path: _tests\bug.txt or C:\Users\me\Scilab\_tests\bug.txt expected
--> file("close",fid)
ERROR LOG:
----------
None. Wrong result
HOW TO REPRODUCE THE BUG:
-------------------------
d = pwd();
fid = file("open","test.txt","unknown");
[?, ?, filepath] = file(fid); filepath
fullfile(d,"test.txt") == filepath
cd ..
[?, ?, filepath] = file(fid); filepath
filepath <> "test.txt"
file("close",fid)