Re: Re[2]: What happens if disk full?
- Posted by Irv Mullins <irvm at ellijay.com> Mar 19, 2001
- 400 views
On Mon, 19 Mar 2001, aku at inbox.as wrote: > Oh yes I forgot that I can use a floppy. > > I tested this program > > object fn,i > fn = open("A:\\filefull","wb") > include file.e > include get.e > i=0 > while 1 do > puts(fn, "x") > i+=1 > printf(1, "%10d %10d\n", {i, where(fn)}) > if get_key() != -1 then exit end if > end while > > Here is the result (confusing): > (my floppy disk is about 136 KB free) > > In DOS: > puts() runs normal and no error messages, but the file pointer > (where()) is increasing, then decreasing, then increasing... and so > on. You can try the example above. Very strange. And puts() DOES NOT > write to disk when it's full.. > How I know that puts() really write to disk? > And how I know if the disk is full... On Linux, I get a message that where() failed: here is part of ex.err: /home/irv/euphoria/include/file.e:37 in function where() where() failed on this file fn = 3 .. called from test.exu:9 Global & Local Variables test.exu: fn = 3 i = 47105 So, how _do_ we know when the disk is full, in a manner that allows the program to handle it gracefully? Rob? Anyone? Regards, Irv