IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Long path names and Windows.
Windows has some odd limitations when it comes to file and pathnames. Most of them are API limitations (as in, the limit is part of the documented API call), not OS limitations. Some of them go back to Windows 3, perhaps even DOS 2!

One I particularly remember: Pathnames have a limit of 254 characters. Not absolute pathnames: just a pathname. You can be in a current directory whose absolute pathname is 160 characters and you can successfully open a file using a relative path that is also 160 characters! In fact, I think a "current directory" can actually be much longer than 254 characters, but you can't change directly into it (obviously) and Windows does get a little funky displaying such a path. Explorer does not have the smarts to take advantage of this.

Also, there are similar limitations in the SMB protocol, too. I doubt you're hitting that in your case, but I've seen it in several un-related scenarios, both onto Window servers and onto Linux servers.

Adding UCS2 encoding, which is what a lot of NT3 API calls want, makes all this a whole lot more complicated. Sometimes the limit is 254 characters, sometimes it is 254 bytes.

Wade.

"Ah -- I take it the doorbell doesn't work?"
New Re: Long path names and Windows.
My understanding of the limits are:

1) The buffer for the pathname you're trying to access is 255 characters ling (remember everything is C-ish, so that extra character slot is for the terminating '0'), so static is right in that there are 254 useful characters. If the path is relative, then you have an additional 254 characters of path name space available for the name. So go to the directory and back up those long filenames; if you start at C:, you're doomed.

2) Windows

HTH




(No, that 2nd one wasn't a typo...)


Welcome back, my friends, to the show that never ends! (Disk crashes notwithstanding...)
jb4
     I hate Windows. - (Another Scott) - (3)
         Long path names and Windows. - (static) - (1)
             Re: Long path names and Windows. - (jb4)
         So does this chap - (Ashton)

Make it so.
111 ms