in reply to Re: File Locking in CGI programs
in thread File Locking in CGI programs

I do check for a failure on open(); I just left that out as not relevant to the question. The code is running on a linux system (FC3) so is it sane enough so that I don't need to do the file locking? The string I write out may have embedded carriage returns if that makes a difference.

Replies are listed 'Best First'.
Re^3: File Locking in CGI programs
by perrin (Chancellor) on Jul 06, 2005 at 02:22 UTC
    You can check the open() man page on your system, but I believe it's safe if the data fits in one block, which typically means 4K or less on Linux.
Re^3: File Locking in CGI programs
by duff (Parson) on Jul 06, 2005 at 03:49 UTC

    Whether you check return values is always relevant IMHO. You should at least include it to let us know you thought about and are doing it so as not cause someone to chase after a potential red herring in your code.

    See my earlier message in this thread. Were you checking the return value of close()? It's highly relevant.

      I'll be more careful in the future to make it clear if I'm checking returned values from system calls. And I am checking the return value from close() now. I wasn't before.