[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSBundle -initWithPath: warning

From: David Ayers
Subject: Re: NSBundle -initWithPath: warning
Date: Fri, 01 Apr 2005 11:12:43 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041217

Sheldon Gill wrote:
David Ayers wrote:

No ... I'm not sure ... I'm not a windows user.
I have been treating a UNC path of the form '//host/share' like a drive-relative path of the form 'C:' and assuming that it should be considered 'relative' because it specifies a dvice but not as particular location on the device. I'm pretty convinced that 'C:' or 'C:file' are relative paths and 'C:/' and 'C:/file' are absolute.

Yes, "C:file" is relative. "C:\file" is absolute. If you think of it as a forest of directory trees and the drive specifying which tree you're talking about it makes a lot more sense. If you parse out the "C:" you get "file" and "/file".

Very interesting, indeed.  I just tried another experiment:
cd C:\TEMP
mkdir C:Test
and indeed, it did create C:\TEMP\Test

You can't change directories to a UNC path. You've got to mount it as a local drive, first: 'net use x: \\host\share'

Oh, I was aware of how to create a drive, I was just trying to explore the semantics of UNC paths.

UNC paths are handled by the file system layer but the DIR command is handled by the CMD.exe shell itself and that does various checks. Hence the confusion in behaviour.

The unfortunate reality is that the different commands do different checks on the path strings they are given so you end up with a variety of behaviours. Quite confusing until you go digging.

We could definitely use some some precise documentation of the relevant issues here in regard to what our path handling behavior should be.

I mean, are we/should we be tracking the "current directory per drive"?
What does it mean to -changeCurrentDirectoryPath:
- in the simple case where the drives match (this seems trivial)
- when the drives don't match?

... so that subsequent [obj writeToFile: @"D:file" atomically: YES] will "do the right thing"?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]