Mailing Lists: Apple Mailing Lists

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

file locking problem about smb sharing network file



Hi:
Everybody. I meet a problem when i try to locking a file using java
class: FileChannel and FileLock. The file located in a sharing
directory of a smb server mounted to a local file system. I use the
mac os X 10.3.3.
The souce code showed as following:
    RandomAccessFile raf =
        new RandomAccessFile(parametersPath+"lock.dat", "rw");
    FileChannel channel = raf.getChannel();
    FileLock lock = channel.lock();
When program executed to channel.lock(), java throw a IOException:
Operation not supported.
I never met the problem when i run the codes on the windows or linux.
And it never happended when i lock a local file!  So i think it is a
java problem of file locking on network filesystem of Mac OS. I have
found some document about the smb file lock on Mac OS X. But they are
not relevant to java.
I guess one possibility is the mount_smbfs mode of  Mac OS. Or Mac OS
do not support the file locking of network filesystem.
Is there anybody met the same problem? i have tired about it.
Thanks! 
Regards
Lucas
 _______________________________________________
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.