 |
|
 |
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...
|
|
|
|
 |
|
|
 |
|
 |
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
|
|
|
|
 |
|
|
 |
|
 |
Thanks,
I use it in a portable way : in a folder with dropbox
So here it is a batch with no need to customize anything anymore :
Create a file in the main folder of the zip,
named for example "touch - (re)install in contextual menu.bat"
and put this code in it :
set tmpfile=_tmp.reg
echo Windows Registry Editor Version 5.00 > %tmpfile%
echo [HKEY_CLASSES_ROOT\*\shell] >> %tmpfile%
echo [HKEY_CLASSES_ROOT\*\shell\touch] >> %tmpfile%
echo [HKEY_CLASSES_ROOT\*\shell\touch\command] >> %tmpfile%
set folder=%CD%
set folder=%folder:\=\\%
echo @="\"%folder%\\Release\\touch.exe\" \"%%1\"" >> %tmpfile%
regedit /s %tmpfile%
del %tmpfile%
cls
@echo Install has completed successfully !
@pause REM You can comment or delete this line to close the window
Now you just have to double click on this file and touch will be in the contextual menu
P.S:
My batch skills are not high so let me know if the quality of this code can be enhanced !
P.S 2:
Same licence !
|
|
|
|
 |
|
 |
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...
|
|
|
|
 |