🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #486

Re: File Locking in IO classes

#486
From: Vander
Date: Tue, 19 Apr 2005 18:54
32 lines
2239 bytes
Kevin Dean [TeamB] wrote:
> Vander wrote:
> 
> 
>>I wonder if there are standard file locking mechanisms implemented
>>for the standard Java VM concerning the file IO classes, in a way
>>that you can rely on. Let's focus on RandomAccessFile.
>>
>>RandomAccessFile rf;
>>File file ... ;
>>String modus ... ;
>>rf = new RandomAccessFile( file, modus );
>>
>>If I want to make sure (or as sure as possible from the Java
>>perspective) that "file" is declared for "exclusive" access in the
>>operating system, do I need to apply calls to rf.getChannel()? Or
>>does it suffice to open rf in "rw" mode and the Java implementation
>>already organizes this part for me?
>>
>>Similar questions may be put for the other file IO classes,
>>FileOutputStream and FileInputStream. I have found no assertions in
>>the Java documents about any standard access modi activated.
> 
> 
> A search for "java file locking" (minus the quotes) on Google yields
> the following:
> 
> http://javaalmanac.com/egs/java.nio/SetFileLock.html
> 

Very nice! But that was nit the question.
- Vander
Technical Details
Message-ID: <42655400@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!fr.ip.ndsoftware.net!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <4264c9b6@newsgroups.borland.com> <xn0e16k112pcdb004-kdean@www.teamb.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: f74b3,a6ef220bf23e44de
X-Google-Attributes: gidf74b3,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Tue, 19 Apr 2005 20:54:48 +0200
From: Vander <874505@gmx.de>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language
Subject: Re: File Locking in IO classes
References: <4264c9b6@newsgroups.borland.com> <xn0e16k112pcdb004-kdean@www.teamb.com>
In-Reply-To: <xn0e16k112pcdb004-kdean@www.teamb.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 62.226.23.102
Message-ID: <42655400@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1113936896 62.226.23.102 (19 Apr 2005 11:54:56 -0800)
Lines: 32
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!fr.ip.ndsoftware.net!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail