-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 2005-03-16 15:28:25 +0000 David Ayers <address@hidden> wrote:
The first paragraph was talking about the implicit conversion that
OPENSTEP for NT does. It would allow things like:
[@"test" writeToFile: @"C:\\Temp/test.txt" atomically: YES];
s = [NSString stringWithContentsOfFile: @"C:/Temp\\test.txt"];
I don't know whether we currently also support this on cygwin/msys/mingw
but this has lead to real confusion and down right problems with some
versions of OPENSTEP (or WebObjects) that didn't always handle it
correctly.
We don't support it ... but I think the examples you provide would work.
The reason being ... we expect paths to be in posix format internally and
convert to windows native format at the point when we do a file operation.
In both cases, those strings look like relative posix path names
containing
a single separator ...
so 'C:\Temp/test.txt' would get the '/' converted to '\' and end up as
'C:\Temp\test.txt' in the windows native format, and 'C:/Temp\text.txt'
would similarly end up as 'C:\Temp\text.txt' at the point where it is
passed
to the windows system call to write or read the file.
However, -lastPathComponent would return 'test.txt' for the first string
and
'Temp\test.txt' for the second string as these are assumed to be posix
paths.
Perhaps OPENSTEP did the same thing?