[Mono-osx] Pathnames with trailing "\0" bytes on Mac OS X 10.6.6

Greg Earle riot.nrrrd.mail at gmail.com
Wed Mar 2 22:35:29 EST 2011


Hi,

First post, Mono newbie.  Please be gentle  :-)

I just installed 2.10.1 so I could run an iPhone Backup Extractor program (there are 2; the Mac-native one crashes on me, so I'm trying the Windows version under Mono).

When I ran the program it was complaining about not finding the Sqlite DLL even though it was in the very same folder.  I ran it under "dtruss" and saw something interesting:

open_nocancel("/Volumes/Music/downloads/iphonebackupextractor-latest/Mono.Data.Sqlite.dll\0", 0x20000, 0x0)	 = -1 Err#2
stat("/Volumes/Music/downloads/iphonebackupextractor-latest/Mono.Data.Sqlite.dll\0", 0xBFFFED7C, 0x0)		 = -1 Err#2
stat("/Volumes/Music/downloads/iphonebackupextractor-latest/Mono.Data.Sqlite.exe\0", 0xBFFFED7C, 0x0)		 = -1 Err#2
stat("/Volumes/Music/downloads/iphonebackupextractor-latest/Mono.Data.Sqlite/Mono.Data.Sqlite.dll\0", 0xBFFFED7C, 0x0)		 = -1 Err#2
stat("/Volumes/Music/downloads/iphonebackupextractor-latest/Mono.Data.Sqlite/Mono.Data.Sqlite.exe\0", 0xBFFFED7C, 0x0)		 = -1 Err#2
open_nocancel("/Library/Frameworks/Mono.framework/Versions/2.10.1/lib/Mono.Data.Sqlite.dll\0", 0x20000, 0x0)		 = -1 Err#2
open_nocancel("/Library/Frameworks/Mono.framework/Versions/2.10.1/lib/Mono.Data.Sqlite.exe\0", 0x20000, 0x0)		 = -1 Err#2

"Err#2" is obvious ENOENT (No such file or directory).

The file is there:

[19:20] mymac:/ % ls -l /Volumes/Music/downloads/iphonebackupextractor-latest/Mono.Data.Sqlite.dll
-rw-rw-rw-@ 1 riot  riot  138240 Sep  6  2009 /Volumes/Music/downloads/iphonebackupextractor-latest/Mono.Data.Sqlite.dll

but obviously it's named "Mono.Data.Sqlite.dll", not "Mono.Data.Sqlite.dll\0".

Every readlink() or stat() or open() of a path in the trace output has a "\0" at the end, as you can see.  So it's unable to find vital files it needs.

I don't know much about Windows under the hood - does Windows just silently ignore any NULL byte terminators in path specifiers, and everything Just Works?

[Oddly enough, the program runs, which I think is amazing considering how many files - library files, DLLs, etc. - it doesn't seem to find due to this.]

Any insights?

Thanks,

	- Greg



More information about the Mono-osx mailing list