[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #45816] canonicalize_file_name() changed behav
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #45816] canonicalize_file_name() changed behavior between 3.8.2 and 4.0.0 on windows |
Date: |
Mon, 31 Aug 2015 22:41:42 +0000 |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0 |
Follow-up Comment #7, bug #45816 (project octave):
I agree with Mike that we don't want to re-write canonicalize_file_name() and
that it should just be a thin wrapper over the gnulib function of the same
name. If everyone is really peeved about which way the slashes lean then
Octave could use a second pass on top of canonicalize_file_name to sort them
out as suggested by the gnulib maintainers.
There is a difference between canonicalize_file_name and
make_absolute_filename in that the first checks for the existence of the file
or directory. If it does not exist it returns the empty string.
make_absolute_filename does no checking whatsoever and is only concerned with
whether the input string looks like a valid path.
For those who need a cheap replacement,
tmp = canonicalize_file_name (str);
path = strrep (tmp, '/', '\');
Or, if you're feeling crafty, you can override the existing implementation
with your own function in a .octaverc file.
canonicalize_file_name = @(x) strrep (builtin ('canonicalize_file_name', x),
'/', '\')
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?45816>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/