On 16 May 2005, at 22:54, Jean-Denis Girard wrote:

Andres Paglayan a �crit :

File::copy does copy, it re-writes the file,
you need to move it.
so when the the pointer is placed the file is already there.


Well from File::Copy man page, about the move() function: "If possible, move() will simply rename the file."

I thought it was the case on Linux, but I'll probably change to system(mv ...) just to be sure.


The 'if possible' thing relates to filesystem design. Almost all of the native UNIX filesystems support mv as an atomic action - but only within the same filesystem. (Imagine you create the file on one physical disk then 'move' it onto a different disk - the kernel has no option but to copy the file).

So create your file in a temp directory on the _same_ file system as
the destination, then do the move.

If your filesystem is remote (samba or nfs) or non unix native (FAT)
then it just won't work.

Tim.


Thanks for all the replies.
Jean-Denis

_______________________________________________
Asterisk-Users mailing list
[email protected]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


_______________________________________________ Asterisk-Users mailing list [email protected] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to