Article View: borland.public.jbuilder.java.api
Article #2186FileInputStream, DataInputStream and file locking problems
From: Jabbar Azam
Date: Mon, 14 May 2001 13:52
Date: Mon, 14 May 2001 13:52
19 lines
1686 bytes
1686 bytes
I have written code like the following
byte[] filebuffer = new byte[100];
DataInputStream in = new DataInputStream( new FileInputStream
("c:\\temp.txt"));
in.readfully(filebuffer,(int)0, 100);
in.close();
This reads 100 bytes from temp.txt and stores them in filebuffer. If I
insert a breakpoint at in.close(), run the program in debug mode in JBuilder
4.0, open temp.txt using notepad and makes changes to it, I am not allowed
to save the modified file in notepad. Is there a way of opening a file in
read only mode in Java which lets another application make changes to the
same file.
I'm trying to run this Java program on Win 2000 and the program which wants
to make the changes is a win32 application.
Thanks in advance
Technical Details
Message-ID:
<989848379.2164.0.nnrp-09.c2464792@news.demon.co.uk>Path:
arc1-ca.pugleaf.net!archiver1.sj.google.com!newsfeed.google.com!sn-xit-02!supernews.com!isdnet!skynet.be!dispose.news.demon.net!news.demon.co.uk!demon![194.70.71.146]!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,52c684f5e5533ef6,start X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2001-05-14 06:53:02 PST Path: arc1-ca.pugleaf.net!archiver1.sj.google.com!newsfeed.google.com!sn-xit-02!supernews.com!isdnet!skynet.be!dispose.news.demon.net!news.demon.co.uk!demon![194.70.71.146]!not-for-mail From: "Jabbar Azam" <ajazam@technolog.com> Newsgroups: borland.public.jbuilder.java.api Subject: FileInputStream, DataInputStream and file locking problems Date: Mon, 14 May 2001 14:52:52 +0100 Message-ID: <989848379.2164.0.nnrp-09.c2464792@news.demon.co.uk> NNTP-Posting-Host: [194.70.71.146] X-NNTP-Posting-Host: [194.70.71.146]:194.70.71.146 X-Trace: news.demon.co.uk 989848379 nnrp-09:2164 NO-IDENT [194.70.71.146]:194.70.71.146 X-Complaints-To: abuse@demon.net X-Newsreader: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Lines: 21