linux os.rename() not an actual rename?
jon+usenet at unequivocal.co.uk
Mon Jul 20 20:43:00 CEST 2015
On 2015-07-20, Jason H <jhihn at gmx.com> wrote:
> I have a server process that looks (watches via inotify) for files
> to be moved (renamed) into a particular directory from elsewhere on
> the same filesystem. We do this because it is an atomic operation,
> and our server process can see the modify events of the file being
> written before it is closed. The rename functions as a 'completed'
> event. We have a python script that attempts to perform this
> behavior - to os.rename() a file into the watched directory after it
> is done being written. However unlike other tools, we don't see a
> proper 'rename' event. Instead we just see a 'changed' event. I've
> changed the implementation of the script to os.system('mv ...') and
> we get the expected 'rename' event.
> Is this known issue? Should I be seeing a proper rename event? The
> only mention in the docs about the rename behavior is that it is
> atomic, as required by POSIX.
os.rename() should just be calling the operating system rename(2)
function. I think you must be doing something wrong.
More information about the Python-list