Article View: borland.public.jbuilder.java.language
Article #482Re: File Locking in IO classes
From: Kevin Dean [TeamB]
Date: Tue, 19 Apr 2005 13:31
Date: Tue, 19 Apr 2005 13:31
38 lines
2430 bytes
2430 bytes
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 -- Kevin Dean [TeamB] Dolphin Data Development Ltd. http://www.datadevelopment.com/ NEW WHITEPAPERS Team Development with JBuilder and Borland Enterprise Server Securing Borland Enterprise Server http://www.datadevelopment.com/papers/index.html Please see Borland's newsgroup guidelines at http://info.borland.com/newsgroups/guide.html
Technical Details
Message-ID:
<xn0e16k112pcdb004-kdean@www.teamb.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!nntp.abs.net!news-FFM2.ecrc.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4264c9b6@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: f74b3,a6ef220bf23e44de
X-Google-Attributes: gidf74b3,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Kevin Dean [TeamB]" <NkOdSePaAnM@datadevelopment.com>
Subject: Re: File Locking in IO classes
Newsgroups: borland.public.jbuilder.java.language
References: <4264c9b6@newsgroups.borland.com>
Organization: Dolphin Data Development Ltd.
User-Agent: XanaNews/1.17.3.1
X-Face: ":yn4zt^A_dn>6~{YJmu^B\'4w)e:apPM\VC=Dvf&*tASxX9|BYczkFd$xr.$vNSZ[3Uobr
p]c4\+\l){!WQI.$]veP({HLd;CDYH?iN
Message-ID: <xn0e16k112pcdb004-kdean@www.teamb.com>
X-Ref: newsgroups.borland.com ~XNS:0000017D
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 24.57.153.235
Date: 19 Apr 2005 05:31:09 -0800
X-Trace: newsgroups.borland.com 1113913869 24.57.153.235 (19 Apr 2005 05:31:09 -0800)
Lines: 38
X-Authenticated-User: kdean
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!nntp.abs.net!news-FFM2.ecrc.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail