[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #36677] canonicalize_file_name: inconsistent b
From: |
Philip Nienhuis |
Subject: |
[Octave-bug-tracker] [bug #36677] canonicalize_file_name: inconsistent behavior for non-existing files |
Date: |
Sun, 02 Sep 2012 20:36:56 +0000 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.11) Gecko/20100701 SeaMonkey/2.0.6 |
Follow-up Comment #11, bug #36677 (project octave):
Thanks.
My C++ proficiency is simply too meager to be able to fix this.
But I can outline what the code might need to do:
- check if we're on Windows
- if yes, check if "filename" contains leading drive letter
(e.g., a pattern like [a-zA-Z]: )
## FIXME: what to do with 'file:///...' constructs? These
## are not supported but are fairly generally used
- if yes, get/isolate that driveletter
.compare with drive letter of cwd
- if (not equal)
opwd = pwd # save current dir
# get current dit on other drive. s/th like "system"?
.[~, npwd] = system ("cd <driveletter>:")
.cd (npwd)
.make_absolute_filename (filename)
# Ready. Restore
.cd (opwd)
endif
endif
endif
endif
The idea is of course to temporarily switch to the other drive to avoid
do_make_absolute cluttering up.
Other than that on windows it doesn't work across drive letters (with files
that exist or not), make_absolute_filename indeed fits the bill.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?36677>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/