Thanks! just for the sake of curiosity, what happens now when a multiple file write occurs? I mean does the routine simply return 0 or does it wait for the file handle to be available and then write? is there some way to have the routine order a background write in the case of a locked file, so the rest of the script can carry on with what its doing.. or is that a bad idea??