1. Re[2]: What happens if disk full?

I> Try it on a floppy.
I> Using Linux, you can write until the disk is full, then your 
I> program ends - no error message, and if there is an error 
I> code returned, I can't find it.


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...

new topic     » topic index » view message » categorize

2. Re: Re[2]: What happens if disk full?

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

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu