Wrox Programmer Forums
|
Java GUI Discussions specific to programming Java GUI.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java GUI section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 15th, 2004, 02:23 AM
Authorized User
 
Join Date: Sep 2003
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default FileLock()

Hello,

I am currently writing a program which requires me to create a locked file, which a user can edit, and then the file be distributed to a/some server/s. We have managed to get this working under windows using the FileLock lock() method. However in Linux, due to the way Linux locks files, if the same .class file is used, multiple locks can be obtained, potentially from different users, on the same file (This could potentially lead to a lost update problem, etc) I have tried creating unnamed new objects from each required class (IE the Server, and the Client) using just new LockingServerTry() and new Client3GUI(); which istself calls new Client2(). This didn't work. Inefficent I know, but thats the way my lecturer wants it. (IE He can run it with and without a GUI)

Does anyone have any ideas how I could solve this problem? Websites are good, as are (small) snippets of code or a java class file name (EG FileChannel, or FileLock) The package it comes from would be useful as well (EG FileChannel and FileLock are java.nio.channels)

If anyone wants my code, then I will post it up here, however it is long (At last count 400 - 500 lines per .java file) and as such if I can avoid it, I will!

I thank you in advance for any help you are able to offer me.
Sincerely

---
David Thorne, Student
UK
__________________
---
David Thorne, Student
UK









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.