 |

|
i took your code and added an EXIF option (and a verbose option) to it. I can now clean up pictures from my camera, and "touch -e" resets all of the dates back to the EXIF date and times. I would be happy to give you the code...
have fun....YitzY
|
|
|
|

|
Super article. I wish there was a recursive option. Never mind. I will extend it to fit my purpose!
Thanks again!
|
|
|
|

|
Thanks for writing this utility! It is particularly useful in situations when XCOPY is used to clone directory structures but creates new subdirectories with the current date/time rather than the original timestamp of the source. I had some rather complicated scripting to try to "restore" the directory time stamps by reading the reference directories - all done using the win32 port of gnu touch -- however, when running on x64 windows, the win32 port utilities are slow (emulation) and having your native Windows version and the -r option of using another file/directory as a "reference" looks great. I was thinking of one enhancement: would it be possible to add the ability to choose the lesser - or greater - timestamp (destination or the directory/file specified by -r)? In the case of directories, I would like the option of applying the timestamp of the -r reference only if it is less (i.e., leave the destination timestamp untouched if the reference is newer. Of course, if I'd used robocopy from the start with its preserve directory timestamp option, I wouldn't need your utility to clean up afterwards ::
|
|
|
|

|
Hi, I'm having a really hard time finding a utility to do what I need done - to change the "Date Taken" field on a bunch of photos taken when the camera's Date/Time settings were not correct. I have yet to find a "Touch"-type utility that will do this, and unfortunately yours is no exception. I don't know whether this is a really hard feature to implement, since it involves interpreting the EXIF data embedded within the file, or whether nobody considers it important enough to bother with. Surely I can't be the only user out there who needs to do this! Please consider adding this feature for any future revision you might do. Thanks!
-- Jeff
|
|
|
|

|
I like the licence...
|
|
|
|

|
Am I getting a beer? --
Kein Mitleid Für Die Mehrheit
|
|
|
|

|
Hello,
i expected touch.exe to create a new file with this:
touch C:\test.txt
but nothing happens. No new file, like it would happen in unix' touch.
Is this not implemented?
Thank you,
franc
|
|
|
|

|
That's probably because you don't have access rights to modify C:\. What error messages are you getting?
This program is indeed designed to create an empty file if one is not present.--
Kein Mitleid Für Die Mehrheit
|
|
|
|

|
I don't get a new file either. And yes I can create files in any dir. With me touch simply finishes as if it's done its job, no messages. Do you want to know more?
|
|
|
|

|
Sounds bizarre... The CreateFile() call is checked for errors, and any such error is printed to screen. Could it be some virtualization trick in Vista/W7? --
Kein Mitleid Für Die Mehrheit
|
|
|
|

|
I found the error, and I fixed it. Turns out that the glob/wildcard support patch I got a couple of years ago contains a bug! Submitted the code just now. --
Kein Mitleid Für Die Mehrheit
|
|
|
|

|
This one works, thanks. Do you have plans for more features? Like ignore attributes (read-only) or change dates of a directory? (For me, the gnu touch does not change directories either)
|
|
|
|

|
| I added the support for directories. Update has been submitted, and will probably go online later today! --
Kein Mitleid Für Die Mehrheit
|
|
|
|

|
This is very useful to me. Thanks! I've only used it on a 2k/FAT32 install now but will try other (NTFS) stuff later. Edit: When a file does not exist yet it gets created with the date/time it is given by touch. But if a dir does not yet exist it gets created with the current date/time. So if another timestamp is needed the same "touch -d -t yyyymm..etc" must be run again for a dir. Is that how you want it?
-- Modified Thursday, March 18, 2010 3:06 PM
|
|
|
|

|
I found it. Someone gave me a patch for glob support, and then a bug was introduced. I'll fix it... --
Kein Mitleid Für Die Mehrheit
|
|
|
|

|
Here's a registry snippet for adding a touch command to the context menu when right-clicking files:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell]
[HKEY_CLASSES_ROOT\*\shell\touch]
[HKEY_CLASSES_ROOT\*\shell\touch\command]
@="\"C:\\Utils\\touch.exe\" \"%1\""
Save the snippet to file touch.reg. Update the path to touch.exe (remember to keep the '\\' characters). Double-click touch.reg and click Yes to add the info into the registry.
I use this when deploying ASP.NET applications on the local intranet. It's a convenient way to have the application restart without restarting the web server.
Enjoy!
-- modified at 11:41 Thursday 1st February, 2007
|
|
|
|

|
Thanks for sharing!
--
Verletzen zerfetzen zersetzen zerstören
Doch es darf nicht mir gehören
Ich muss zerstören
|
|
|
|
|
|

|
Well Done - it just works !!
It's great when something just works as it says it does.
This should be in sysinternals.
Chris Ringrow
|
|
|
|

|
Thanks!
--
Verletzen zerfetzen zersetzen zerstören
Doch es darf nicht mir gehören
Ich muss zerstören
|
|
|
|

|
I didn't see a recursion option (for sub-directories). That would be a nice add-on.
|
|
|
|

|
Well, title say it all. I used VC++ Express to compile the project, and there were a couple of "deprecated" message while building.
|
|
|
|

|
Nice utility - does what it claims, and does it well.
~ Nazgûl
+++++++++++++
|
|
|
|

|
GNU Win32 project has a latest version of touch compiled for win32 platform. I say, don't reinvent the wheel - use existing tools!
Ok. There is one (only one!) exception to my rule - you *can* reinvent the wheel if you're doing that for learning purposes.
GNU Win32 project[^]
Package that contains touch[^]
|
|
|
|

|
Because I wrote it for a) fun, b) someone asked for it a long time ago. If you don't want to use it, that's fine with me.
|
|
|
|

|
Ok, in that case i would like to add one more exception to my rule - it's ok, if it is done for fun.
So if you're learning or just having fun - it's ok to reinvent the wheel...
|
|
|
|
|
|

|
You saved me from boring works. Thanks a lot! ^^
김동일 / Kim, Dong-il
Remember the difference between a boss and a leader: a boss says "Go" a leader says "Let's go"
|
|
|
|

|
?????
|
|
|
|

|
Doh. I meant to write "kam sam ni da", but in Hangul. It would seem that I'd have to figure out the unicode values and encode the symbols as html entities, because obviously, CP is not unicode.
|
|
|
|

|
NIt's my pleasure.
I make some update to your source code.
This modified version supports wildcard parameter.
http://user.chol.com/~phaeton/codeproject/touch_20060215.zip
Hoppas du har en trevlig dag.
김동일 / Kim, Dong-il
Remember the difference between a boss and a leader: a boss says "Go" a leader says "Let's go"
-- modified at 6:43 Wednesday 15th February, 2006
|
|
|
|

|
Thank you very much for the update! I will try to update the article right away. (Might take some time as this article is already edited, and cannot be modified directly by me anylonger)
PhaetonTheGreat! wrote: Hoppas du har en trevlig dag.
Tack detsamma!
|
|
|
|
|

|
No good if you need a command line touch
|
|
|
|
|

|
can you run this program from a cgi file like
`touch finenamehere`;
|
|
|
|

|
I suppose so. I guess it depends on the capabilities of the web server.
--
Arigato gozaimashida!
|
|
|
|

|
I was hoping you could add directory support to your touch utility. I have been unable to find any other utilities to modify the creation time stamp of directories.
Thank you for your time.
|
|
|
|

|
TouchPro can modify directory timestamps - you can get it here: www.jddesign.co.uk
|
|
|
|

|
Hmm, TouchPro seems like a step in the wrong direction. It's a Windows GUI app that registers itself into Windows Explorer -- hardly a lightweight W32 app like Jörgen's demo. TouchPro includes a command line version but jddesign forces you to register with them before you can use it.
Why don't you use gnu or cygwin Win32 touch.exe for directory touch functionality? Sources for both are freely available.
Alternatively, Jörgen might be persuaded to update his demo for this OpenBSD-like functionality. Hint, hint Jörgen!
Hi hi
Willow
|
|
|
|

|
Setting the seconds didn't work correct and the hours are different (perhaps GMT ? i have CEST (GMT+1) on my computer) if i try to set
touch -t 200402191526.04 xxx.txt
sets the filedate to 19.02.2004 16:26:40
|
|
|
|

|
The hour offset is explained by daylights saving. But why 04 becomes 40 is beyond me.. I'm on it.
--
Din mamma.
|
|
|
|

|
Found the problems, and fixed them. Moving on to next error reports....
--
Din mamma.
|
|
|
|

|
The '-h' argument doesn't work. It's not only not explicitly handled, a single argument is always assumed to be a file name.
If the file doesn't exist, no error is emitted. Instead, the file is created. (Why this is the default is beyond me.
Project won't compile with UNICODE; several strings aren't prefixed properly and LPSTR is repeatedly used rather than LPTSTR.
I'd fix it, but this is the first time I've needed the program since I can remember and don't anticipate needing it again any time in the near future.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|

|
Joe Woodbury wrote:
If the file doesn't exist, no error is emitted. Instead, the file is created. (Why this is the default is beyond me.
That's traditional UNIX semantics for ya.
I'm looking into the unicode stuff as I write this...
--
Din mamma.
|
|
|
|

|
Jörgen Sigvardsson wrote:
That's traditional UNIX semantics for ya.
So true[^] (although I must add I am not a fan of ESR)
|
|
|
|

|
Everything fixed, included the stuff reported in the post above yours. I'll submit the changes now to the editors..
--
Din mamma.
|
|
|
|
 |