Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with File.exists() and surrogate pairs in filename



Scott Kovatch wrote:

While I can't see the full implementation of exists(), I can see that it eventually passes the File object into native code in UnixFileSystem. I also know that the file system represents file names in UTF-8. NSFileManager's fileSystemRepresentation effectively does this for you, but calling that via JNI (or, in my case, Eclipse SWT's OS layer) gave me the same results as calling String.getBytes("UTF-8"), so something else is going on.


You can enable kernel tracing with the 'ktrace' command. Look through the resulting system calls and see if stat() or lstat() is among them. Then look at what pathname it's getting.

I would condense the fail-case down to a non-interactive, non-GUI example, or the amount of ktrace data will be huge.

You might also look into dtrace.

Or set a breakpoint on stat() and lstat() (they're just C functions) and see what pops up.

  -- GG

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.