![]() |
Web Development »
Applications & Tools »
Tools with source code
Intermediate
License: The BSD License
Touch for WindowsBy Jörgen SigvardssonThis is the touch tool ported to Windows |
VC7, VC7.1Win2K, WinXPVS.NET2003, Dev
|
|
Advanced Search Add to IE Search |
|
|
|
||||||||||||||||
I've seen at least two people asking for a Windows version of the UNIX utility touch this past week. So here it is: a Windows version of the OpenBSD touch command. It's not fully compatible as my utility can only touch one file at a time and does not support the -f argument (force touch, ignoring access rights). However, my version supports altering modification, access and creation time, while the OpenBSD version only supports alteration of access and modification time.
If you have a need for a touch utility which ignores access rights and can handle multiple files (including globing), tell me and I'll see what I can do.
I've also made sure it's UNICODE compatible, but as my system is as western as it gets, I haven't really been able to test it. If you find anything fishy when compiled as a UNICODE binary, please let me know.
For those who don't know, here's a simple explanation: It updates the dates associated with a file to whatever you want it to be. It can change access, modification and creation dates. You as a user can update them independently of each other, you can update them with any possible date. Dates can be now, user specified or copied from another file. If you try to touch a file which does not exist, this command will create it for you (empty of course).
You can always run touch -h for help.
This is not rocket science. I'm basically just using simple Win32 API functions. Writing an article about it would be like reciting the MSDN documentation. If you are interested in how it works, use the source - it's not big and it doesn't really contain any surprises.
You are granted a license to use the code for whatever purpose, if and only if the following conditions are met:
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 15 Feb 2006 Editor: Smitha Vijayan |
Copyright 2002 by Jörgen Sigvardsson Everything else Copyright © CodeProject, 1999-2009 Web20 | Advertise on the Code Project |