NetAccess::file_copy and modification time
David Faure
faure at kde.org
Fri Jun 18 14:33:02 BST 2004
On Friday 18 June 2004 13:40, Andras Mantia wrote:
> On Friday 18 June 2004 14:09, you wrote:
> > So is there a (simple) way to do an overwriting copy by preserving
> > the modification time or do I have to use KIO::copy and be sure that
> > the target does not exists?
>
> I was wrong, there is no difference between file_copy and copy.
> Modification time is not preserved when the copy is from a remote file
> (possibly it isn't also when the copy is to a remote file). So the
> question is: is it possible to preserve the modification time when
> copying from/to a remote file?
Currently the utime() is done by kio_file when copying from local to local, indeed.
Doing it from file_copy, when doing a get() and a put(), sounds impossible. It's too
low-level. It could be done from CopyJob, since that one lists the sources (or stat()s
it, for a single file), so it knows the atime/mtime. We would need a new
special() call (or a better named call in KDE4) to set the atime/mtime over any
protocol.... It's mostly for kio_file as destination though.
Is that enough information for the patch you're about to write? :-P
--
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
More information about the kde-core-devel
mailing list