From: Frank L. <fra...@go...> - 2011-01-26 21:53:06
|
2011/1/26 HAT <ha...@fa...>: > Frank Lahm <fra...@go...>, Wed, 26 Jan 2011 16:49:20 +0100 >> 2011/1/26 HAT <ha...@fa...>: >>> Frank Lahm <fra...@go...>, Wed, 26 Jan 2011 16:40:45 +0100 >>>>>>> BTW, >>>>>>> Mac OS X's tar command can save 255-over filename. >>>>>>> Mac OS X's tar command CAN extract this archive. >>>>>> >>>>>> Really? I must check that out if I have the time too as I wouldn't >>>>>> believe it until seen myself. As can be seen using the code example >>>>>> below, it's just not possible to get creat(2) (which is just a wrapper >>>>>> for open(2) w. O_CREAT) to create a file with a name longer NAME_MAX. >>>>> >>>>> See attached tar file. >>>> >>>> Where and how did you create that file in the archive ? It's >>>> strlen(name) is 256 and I have no OS at hand which allows me to create >>>> such a file. >>> >>> $ cd /Volumes/afpvol/ >>> $ tar -cf test.tar test/ >>> >>> Extract it on AFP Volume, not HFS+. >> >> I can extract it on HFS+ just fine. I was asking where and how did you >> _create_ it ? > > Server: Mac OS X hostname=cubechan afp://cubechan._afpovertcp._tcp.local/MacOSX > Client: Mac OS X hostname=imacchan > > There is "άάάά...άάάa" in "afp://cubechan._afpovertcp._tcp.local/MacOSX/test directory" . > > hat@imacchan:~ >cd /Volumes/MacOSX/test/ > hat@imacchan:/Volumes/MacOSX/test >ls > άάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάa These are exactly 255 bytes, not more. For most names when I try to rename a file or folder in Finder to a name whos strlen() is greater then 255 bytes, it gets truncated to 255 bytes. One exception is the other name you passed in the dmg, which as it seems triggers an encoding bug in the OS: Inti:~ ralph$ ./create άάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάα Creating: (len: 256) "άάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάα" This succeed without error. Note the strlen of 256 which is one more then PATH_MAX and thus should give an error. Now it gets funny: $ ./create άάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάaa Creating: (len: 256) "άάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάάaa" creat: File name too long Same strlen of 256 bytes and this time we get an error as expected. |