Picking up partial file in Unix

We have an adapter that processes hundreds of files that get copied to a directory over a couple minute period daily. On occassion we it appears the adapter only reads part of a file. The files reside on a unix box. Does anyone know if the unix os puts a lock on a file while it is writing to it. It almost appears the file is being read before the file copy is complete. This is very sporatic and happens only about once every couple of weeks.

Thanks

Ed.

I know this is an old post, but just in case someone else has the same problem. Our experience is that Unix does not lock a file while it is writing to that file, so we were picking up partial files all the time. We fixed this by implementing a new procedure on our Unix system. The policy is that any file is always written to a working or temporary directory until the file is complete. Then we use the Unix “mv” command to rename the file from the working directory to the target directory that the Adapter is polling. Since “mv” just moves the file pointer, the file is always complete. Once we implemented this, we did not have any more problems with partial files.

Did you try to set the File Age in the Port configuration? I believe that the poller will check to see that the file is a certain age before it is processed.

Or maybe you’re not polling.

David is correct in his assessment of the Unix situation with regards to file locking. We recently experienced the exact same behaviour on a project.

As David also states, the solution we implemented was identical to his. Write the file somewhere else (to a working directory), then move the file to the poll directory.

This problem does not occur when polling to a Windows system.

Hello all

I am experiencing the same problem but on an AS400 IFS.
It seems that the files aren’t locked while being written there either.

Neal, what is that File Age in the port you are referring to? Or is it Unix only?