File time stamps

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

File time stamps

Schwab,Wilhelm K
Hello all,

It might be time for me to take another step away from dependence on Windows - something I never quite tire of doing :)  One small item standing in my way (there are big ones too) is a need to set file time stamps on Both Windows and Linux.

I can use SetFileTimeStamp() on Windows, and touch via OSProcess on Linux.  Is there a better way, especially on Linux?

BTW, a copy preserving time stamps won't help: the idea is to get shared drives OUT of the picture, so there either no source or no destination as far as a copy command would be concerned.

Bill




_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: File time stamps

Martin McClure-2
Schwab,Wilhelm K wrote:
> Hello all,
>
> It might be time for me to take another step away from dependence on Windows - something I never quite tire of doing :)  One small item standing in my way (there are big ones too) is a need to set file time stamps on Both Windows and Linux.
>
> I can use SetFileTimeStamp() on Windows, and touch via OSProcess on Linux.  Is there a better way, especially on Linux?
>
> BTW, a copy preserving time stamps won't help: the idea is to get shared drives OUT of the picture, so there either no source or no destination as far as a copy command would be concerned.
>

Never tried this myself, but the utime() system call can change the
access and modification times of a file to any time with one-second
precision, provided you are running as the owner of the file. utimes()
is the same but with microsecond resolution.

And there are some related glibc routines referenced in the man page.

Regards,

-Martin

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: File time stamps

Schwab,Wilhelm K
Martin,

That should do it, because the process messing with the file will almost have to be the owner (I think<g>).  For some time, it will be easy on Linux because that will the client side of the conversation.

To all, if anyone has overcome problems with slow copies between Linux and Windows servers, please don't feel like you'd be cheating me out of something by telling me how to fix it :)

Thanks!!

Bill



-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Martin McClure
Sent: Wednesday, December 23, 2009 11:48 PM
To: [hidden email]
Subject: Re: [Pharo-project] File time stamps

Schwab,Wilhelm K wrote:
> Hello all,
>
> It might be time for me to take another step away from dependence on Windows - something I never quite tire of doing :)  One small item standing in my way (there are big ones too) is a need to set file time stamps on Both Windows and Linux.
>
> I can use SetFileTimeStamp() on Windows, and touch via OSProcess on Linux.  Is there a better way, especially on Linux?
>
> BTW, a copy preserving time stamps won't help: the idea is to get shared drives OUT of the picture, so there either no source or no destination as far as a copy command would be concerned.
>

Never tried this myself, but the utime() system call can change the access and modification times of a file to any time with one-second precision, provided you are running as the owner of the file. utimes() is the same but with microsecond resolution.

And there are some related glibc routines referenced in the man page.

Regards,

-Martin

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project