[译]触摸Windows
By robot-v1.0
本文链接 https://www.kyfws.com/applications/touch-for-windows-zh/
版权声明 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
- 4 分钟阅读 - 1804 个词 阅读量 0[译]触摸Windows
原文地址:https://www.codeproject.com/Articles/3258/Touch-for-Windows
原文作者:Jörgen Sigvardsson
译文由本站 robot-v1.0 翻译
前言
This is the touch tool ported to Windows
这是移植到Windows的触摸工具
介绍(Introduction)
我已经看到至少两个人要求Windows版本的UNIX实用程序(I’ve seen at least two people asking for a Windows version of the UNIX utility)**触摸(touch)**过去一周.所以这里是:Windows版本的(this past week. So here it is: a Windows version of the) OpenBSD的(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(-f)参数(强制触摸,忽略访问权限).但是,我的版本支持更改修改,访问和创建时间,而OpenBSD版本仅支持更改访问和修改时间.(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.)
如果您需要一个触摸实用程序,该实用程序可以忽略访问权限,并且可以处理多个文件(包括gloglo),请告诉我,我会解决的.(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.)
我还确保了它与UNICODE兼容,但是由于我的系统是西方的,所以我还没有真正能够对其进行测试.如果在编译为UNICODE二进制文件时发现任何问题,请告诉我.(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.)
它有什么作用?(What Does It Do?)
对于那些不知道的人,这里有一个简单的解释:它将与文件关联的日期更新为您想要的文件名称.它可以更改访问,修改和创建日期.作为用户,您可以彼此独立地更新它们,也可以在任何可能的日期更新它们.日期可以是(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)触摸-h(touch -h)求助.(for help.)
文章在哪里?(Where’s the Article?)
这不是航天科技.我基本上只是使用简单的Win32 API函数.写一篇有关它的文章就像背诵MSDN文档.如果您对它的工作方式感兴趣,请使用源代码-它并不大,并且也没有任何令人惊讶的地方.(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.)
许可授予(License Grant)
当且仅当满足以下条件时,您才被授予将其用于任何目的的许可:(You are granted a license to use the code for whatever purpose, if and only if the following conditions are met:)
- 您可能不会期望我提供任何担保.如果您弄坏了东西,请修复它.(You may expect no warranties from my part. If you break something, you fix it.)
- 如果我们有一天要见面,您可以给我买我选择的啤酒.这不是必需的,但这将是一件非常不错的事情,我将不胜感激.如果您的宗教信仰禁止您购买酒精,即使不是为自己买酒,也可以喝可乐或任何在道德上和道德上都可以接受的经良好测试的饮料.(If we meet some day in the flesh, you may buy me a beer of my choice. This is not a requirement, but it would be a very nice thing to do and I would appreciate it. If your religion prohibits you from buying any alcohol, even if not for yourself, a coke is fine or whatever well testing beverage which you find morally and ethically acceptable.)
修订记录(Revision history)
- 2002-11-28(2002-11-28)-初始版本(- Initial version)
- 2004-04-03(2004-04-03)-错误修复:UNICODE,参数解析,夏令时,时间字符串解析(- Bug fixes: UNICODE, argument parsing, daylight saving, time string parsing)
- 2006-02-15(2006-02-15)-通配符支持,非常感谢(- Wildcard support, much thanks to) 辉腾大帝(PhaetonTheGreat) !(!)
- 2010-03-16(2010-03-16)-通配符支持引入了一个错误.对其进行了修复,并使其能够处理多个文件和全局模式(- Wildcard support introduced a bug. Fixed it, and gave touch the ability to handle multiple files and glob patterns)
- 2010-03-17(2010-03-17)-增加了对每个请求目录的支持.请参阅新的-d开关.也可以将-r指定为使用目录作为时间源(- Added support for directories per request. See the new -d switch. -r can also be specified to use a directory as a time source)
许可
本文以及所有相关的源代码和文件均已获得The Code Project Open License (CPOL)的许可。
VC7.1 C++ VC7.0 WinXP Windows Win2K Visual-Studio VS.NET2003 Dev 新闻 翻译