This is the mail archive of the
mauve-discuss@sources.redhat.com
mailing list for the Mauve project.
Re: Question about RandomAccessFile Code
- From: Daryl Lee <dlee at altaregos dot com>
- To: Patrick Ellis <Patrick dot Ellis at sas dot com>, Mauve Discuss <mauve-discuss at sources dot redhat dot com>
- Cc: mauve-discuss at sources dot redhat dot com, "Mark Wielaard (E-mail)" <mark at klomp dot org>, "Tom Tromey (E-mail)" <tromey at redhat dot com>
- Date: Thu, 14 Nov 2002 16:28:40 -0500
- Subject: Re: Question about RandomAccessFile Code
- References: <F2E670D5036BE14E89473A3FAEDE6ACE428F6B@merc18.na.sas.com>
I think the raf2 reference must be a residual of some code that I didn't
clean up well when I was in there last. I've tested the code without it
and it seems okay. I'll get it checked in shortly.
On Thu, Nov 14, 2002 at 11:04:12AM -0500, Patrick Ellis wrote:
> Mark/Tom,
>
> During testing of the RandomAccessFile code, a file is create during execution called "raftmpfile". This
> file is used during testing.
> My question is the code makes reference to the file twice in io/RandomAccessFile/jdk11.java but
> raf2 is not used anywhere else in the code. A problem occurs on the VMS platform because of the
> creation of the file twice in the below code. Was this the intent of the code or a bug ?
>
> String fname = "raftmpfile";
> RandomAccessFile raf, raf2;
> int rdcnt;
> byte[] buf = { 0, 0, 0, 0 };
>
> // Start by deleting test file, if it exists,
> // to clear out any leftover data
>
> File f = new File(fname);
> if (f.exists()) {
> f.delete();
> }
>
> // new RandomAccessFile(fname, mode)
> try {
> raf2 = new RandomAccessFile(f, "rw");
> }
> catch (IOException e) {
> harness.fail("new RandomAccessFile(File, mode): Can't open file " + fname);
> return; // can't proceed without open file
> }
>
> // new RandomAccessFile(filename, mode);
> try {
> raf = new RandomAccessFile(fname, "rw");
> }
> catch (IOException e) {
> harness.fail("new RandomAccessFile(Filename, mode): Can't open file " + fname);
> return; // can't proceed without open file
> }
> try {
> FileDescriptor fd = raf.getFD();
> }
> catch (IOException e) {
> harness.fail("getFD(): Can't get FileDescriptor");
> return; // shouldn't proceed if no FileDescriptor
> }
>
> Pat Ellis
> SDE Build and Test Team
> Phone: (919) 531-0355
> R2263 Patrick.Ellis@sas.com
> SAS... The Power to Know
>
>
>
>
--
Daryl Lee
Marietta, GA