• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

File Locking

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I am workign on a Swing application where in I am reading Some Information from Two XML files in to my application. After making some modifiactions to the readin data i am writing that back to the Same File. now I need some help in attaining lock over those two files so that untill my application is running no other programs should be allowed to read from or write in to those files.

i.e. my application should attain lock on these Files When it Starts. And that lock Should be released when the application closes


Please Help me


Thanks in advance...
[ November 01, 2006: Message edited by: Leela murthy ]
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


untill my application is running no other programs should be allowed to read from or write in to those files.


Am I to understand that you want these files to be locked when your application is not running? Or do you want to obtain a lock when you start your application?
 
Well behaved women rarely make history - Eleanor Roosevelt. tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic