reddit discussion on replacing Python in 0install

Walter Bright newshound2 at digitalmars.com
Wed Jun 12 10:58:45 PDT 2013


On 6/12/2013 10:36 AM, "Jérôme M. Berger" wrote:
> 	Actually, the best solution is to check if the file is writable
> before writing and *without flushing*. On Posix systems, this can be
> done with:
>
> fcntl (fd, F_GETFL) & W_OK

Sure, but that doesn't cover the case of a write failure because the disk is is 
near full and then is full.

The write has to be tested to see if it succeeded, not assumed to succeed 
because only one of the possible failure conditions is not present.


More information about the Digitalmars-d mailing list