octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem using copyfile and movefile


From: John W. Eaton
Subject: Re: Problem using copyfile and movefile
Date: Tue, 27 Feb 2007 20:57:39 -0500

On 27-Feb-2007, Michael Goffioul wrote:

| 
| > It would be OK to have these as built-in functions, but I think some
| > care is needed to implement them.  You need to be careful about read
| > and write errors and possibly preserving access and modification time
| > stamps.  Also, moving a file should be done with rename if possible
| > (only works if source and target files are on the same filesystem) but
| > should still work by copy and remove if not (and in that case, you
| > definitely must be careful about open/read/write/close errors).  All
| > these little details add up to the reason that I chose to use cp and
| > mv, which presumably have all the bugs worked out.
| >
| > Rather than inventing a solution just for Octave, I think it would
| > probably be good to use gnulib for these kinds of things, and to
| > enhance gnulib if there is some missing functionality.
| >   
| 
| I had a look at gnulib and found copy-file, which copy one file into 
| another. Due to
| the dependencies, this would add a significant set of files to the 
| source tree.

Yes, there does seem to be a significant barrier to adding the first
gnulib function.  But after that, adding others should be easy, so
maybe it would be worth it anyway?

| Besides
| this, you still have to implement the logic of file overwrite, directory 
| recursive copy
| and so on. Is it worth to add all these additional files for the single 
| operation of binary
| copy of a file with mod/acl preserving (which can be implemented with a 
| few lines,
| even with error detection)?

If it is easy, then propose a patch.  :-)

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]