[Project_owners] Synchronize local file with a remote file

Dan Lee daniel.eric.lee at gmail.com
Mon Feb 27 13:22:57 EST 2006


Hi all,

I have an extension where I'm trying to synchronize a local file with a
remote file.  I want to set the timestamp of the local file to match
that of the remote, but I must not be doing something properly.
I thought I could just modify the lastModifedTime property; I am doing
something like this:

file = Components.classes["@mozilla.org/file/local;1"]
                   .createInstance(Components.interfaces.nsILocalFile);
file.initWithPath( filePath);
file.lastModifiedTime = 11111;  // remote file's timestamp
dump( "lastModifiedTime: " + file.lastModifiedTime + "\n" );
// the above prints file's original timestamp; not what I just set


Do I need to somehow "save" my change after I set the lastModifiedTime?
Thanks for any help.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mozdev.org/pipermail/project_owners/attachments/20060227/c2473252/attachment.htm


More information about the Project_owners mailing list