🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: be.comp.programming
7 messages
7 total messages Started by Passero Sun, 25 Jan 2004 11:15
[java] fout bij schrijven naar RandomAccessFile
#3208
Author: Passero
Date: Sun, 25 Jan 2004 11:15
13 lines
1627 bytes
Wanneer ik probeer te schrijven naar een RandomAccessFile krijg ik deze
foutmelding:

Java.io.IOException: Bad file descriptor
 at java.io.RandomAccessFile.write(Native Method)
 at java.io.RandomAccessFile.writeInt(RandomAccessFile.java:930)
 at Beheerder.schrijfRecordWeg(Beheerder.java:52)

De 52ste lijn van beheerder is zo:
eenBestand.writeInt(eenRecord.getNummer());

eenRecord.getNummer() geeft gewoon een integer terug.
Iemand enig idee aan wat het zou liggen?
Re: [java] fout bij schrijven naar RandomAccessFile
#3210
Author: Stefan Arentz
Date: Sun, 25 Jan 2004 12:10
19 lines
1591 bytes
"Passero" <bla@bla.bla> writes:

> Wanneer ik probeer te schrijven naar een RandomAccessFile krijg ik deze
> foutmelding:
> 
> Java.io.IOException: Bad file descriptor
>  at java.io.RandomAccessFile.write(Native Method)
>  at java.io.RandomAccessFile.writeInt(RandomAccessFile.java:930)
>  at Beheerder.schrijfRecordWeg(Beheerder.java:52)
> 
> De 52ste lijn van beheerder is zo:
> eenBestand.writeInt(eenRecord.getNummer());
> 
> eenRecord.getNummer() geeft gewoon een integer terug.
> Iemand enig idee aan wat het zou liggen?

Je bent vergeten om de file correct te openen gok ik.

 S.
Re: [java] fout bij schrijven naar RandomAccessFile
#3211
Author: Passero
Date: Sun, 25 Jan 2004 12:25
13 lines
1585 bytes
"Stefan Arentz" <stefan@tiSateh.local> schreef in bericht
news:m27jzgxm7u.fsf@tiSateh.local...

>
> Je bent vergeten om de file correct te openen gok ik.
>

rndBestand = new RandomAccessFile(bestand,"rw");

Moet toch niet meer zijn om het bestand te openene?

>  S.
Re: [java] fout bij schrijven naar RandomAccessFile
#3213
Author: Ewoud Dronkert
Date: Sun, 25 Jan 2004 12:37
5 lines
1219 bytes
On Sun, 25 Jan 2004 12:25:53 GMT, Passero wrote:
> rndBestand = new RandomAccessFile(bestand,"rw");
> eenBestand.writeInt(eenRecord.getNummer());

Aha!
Re: [java] fout bij schrijven naar RandomAccessFile
#3214
Author: Passero
Date: Sun, 25 Jan 2004 12:49
10 lines
1625 bytes
"Ewoud Dronkert" <me@privacy.net> schreef in bericht
news:c2e710d664mfnelkskvt9h94ukakb7nbh5@news.individual.net...
> On Sun, 25 Jan 2004 12:25:53 GMT, Passero wrote:
> > rndBestand = new RandomAccessFile(bestand,"rw");
> > eenBestand.writeInt(eenRecord.getNummer());
>
> Aha!

??
Re: [java] fout bij schrijven naar RandomAccessFile
#3219
Author: Ewoud Dronkert
Date: Sun, 25 Jan 2004 17:47
11 lines
1495 bytes
On Sun, 25 Jan 2004 12:49:32 GMT, Passero wrote:
> "Ewoud Dronkert" <me@privacy.net> schreef:
>> On Sun, 25 Jan 2004 12:25:53 GMT, Passero wrote:
>>> rndBestand = new RandomAccessFile(bestand,"rw");
>>> eenBestand.writeInt(eenRecord.getNummer());
>>
>> Aha!
> 
> ??

Ja zeg, rndBestand is niet hetzelfde als eenBestand.
Re: [java] fout bij schrijven naar RandomAccessFile
#3221
Author: Passero
Date: Sun, 25 Jan 2004 18:26
17 lines
1978 bytes
"Ewoud Dronkert" <me@privacy.net> schreef in bericht
news:t80810dgkab2rm25bvffku9cblh1a13dl3@news.individual.net...

> >>
> >> Aha!
> >
> > ??
>
> Ja zeg, rndBestand is niet hetzelfde als eenBestand.

Das de header van mijn methode:
private void schrijfRecordWeg(Record eenRecord,RandomAccessFile eenBestand)
throws IOException

eenBestand gebruik ik gewoon als attribuut in mijn methode en rndBestand is
een gewoon object die de volledige klasse als scope heeft.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads