digitalmars.D.bugs - isabs not working
- Kramer (7/7) Feb 10 2006 The following assert (which is in the unittests) fails for std.path.isab...
- Jarrett Billingsley (8/17) Feb 10 2006 Well, I'm not so sure. In Windows, at least, the path "\relative\path" ...
The following assert (which is in the unittests) fails for std.path.isabs(). assert(isabs(r"\relative\path") == 0); According to the docs (unless I've been starring at the screen for too long), this assert should pass? IMHO though, even for Windows, I think if a path starts with a separator, it should be considered absolute. -Kramer
Feb 10 2006
"Kramer" <Kramer_member pathlink.com> wrote in message news:dsj2nu$29hl$1 digitaldaemon.com...The following assert (which is in the unittests) fails for std.path.isabs(). assert(isabs(r"\relative\path") == 0); According to the docs (unless I've been starring at the screen for too long), this assert should pass? IMHO though, even for Windows, I think if a path starts with a separator, it should be considered absolute.Well, I'm not so sure. In Windows, at least, the path "\relative\path" is actually relative to the current drive - thus, it doesn't provide enough information to uniquely identify a file on the system. It could mean c:\relative\path, or d:\relative\path, etc. I don't know that much about *nix, but is it true that there's no real concept of drives? Or at least, not in the same way as in DOS/Windows?
Feb 10 2006
In article <dsj328$2ae9$1 digitaldaemon.com>, Jarrett Billingsley says..."Kramer" <Kramer_member pathlink.com> wrote in message news:dsj2nu$29hl$1 digitaldaemon.com...Yes, this is true. And I had to think about it for a bit before deciding I thought it was abs. The reason is, in the shell, if you're several directories deep and you do "cd \" it takes you back to the root of that drive. But again, as you say, it's "...relative to the current drive". Ok, so I'll buy that. Then at the very least, isabs should work as stated in the docs.The following assert (which is in the unittests) fails for std.path.isabs(). assert(isabs(r"\relative\path") == 0); According to the docs (unless I've been starring at the screen for too long), this assert should pass? IMHO though, even for Windows, I think if a path starts with a separator, it should be considered absolute.Well, I'm not so sure. In Windows, at least, the path "\relative\path" is actually relative to the current drive - thus, it doesn't provide enough information to uniquely identify a file on the system. It could mean c:\relative\path, or d:\relative\path, etc.I don't know that much about *nix, but is it true that there's no real concept of drives? Or at least, not in the same way as in DOS/Windows?
Feb 10 2006
Jarrett Billingsley wrote:"Kramer" <Kramer_member pathlink.com> wrote in message news:dsj2nu$29hl$1 digitaldaemon.com...Yeah, *nix uses "folders" which point to the device (drive).The following assert (which is in the unittests) fails for std.path.isabs(). assert(isabs(r"\relative\path") == 0); According to the docs (unless I've been starring at the screen for too long), this assert should pass? IMHO though, even for Windows, I think if a path starts with a separator, it should be considered absolute.Well, I'm not so sure. In Windows, at least, the path "\relative\path" is actually relative to the current drive - thus, it doesn't provide enough information to uniquely identify a file on the system. It could mean c:\relative\path, or d:\relative\path, etc. I don't know that much about *nix, but is it true that there's no real concept of drives? Or at least, not in the same way as in DOS/Windows?
Feb 10 2006