Technicalia
|
The canonical_path(file,,CORRECT) form, which is equivalent to canonical_path(file,0,CORRECT),
can simply be replaced (afaik) with canonical_path(file).
The is_directory parameter is ignored. The Phix implementation determines whether path_in is
a directory or file by looking on the disk and does not need to be told.
The Phix version only accepts CORRECT (defined as 2 in psym.e) as a valid setting for case_flags.
The Euphoria version allows other flags: AS_IS, TO_LOWER, and TO_SHORT, none of which are
defined or supported by Phix. AS_IS makes little to no sense: if you are going to preserve the
wrong case of src when something more accurate is on offer, my warped logic suggests you would
want res = randomise_case(current_dir())&src to occur when src is not a full path... Likewise,
TO_LOWER is semi-pointless: either res = lower(canonical_path(src)), or just res = lower(src),
or the TO_LOWER+CORRECT form (in which existing parts of the path are given correct case and
the rest lower) is just simply res = canonical_path(lower(src)). Finally, TO_SHORT is just
something I actively want to avoid: while technically they may still exist 8,3 filenames
should long be forgotten about by now.
The latest Euphoria version appears to have extensive additions for Windows Vista (eg lower
case drive letters, since rescinded), and other unix/case-insensitive filesystem/enhanced dir()
features that I would stand no chance of adequately testing, plus the warning in the Euphoria
documentation "Does not (yet) handle UNC paths or unix links" persuades me against investing any
significant effort here, just yet.
The Euphoria version replaces a leading tilde ('~') with $HOME on Unix platforms and
%HOMEDRIVE%%HOMEPATH% in Windows. Phix does not (yet) support this and were such handling added,
I should hope it would apply equally to open(), dir(), chdir(), etc.
|