免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2367 | 回复: 2
打印 上一主题 下一主题

写了个工具 for Windows & Unix(HP-UX) [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-07-13 11:43 |只看该作者 |倒序浏览
可以获取(显示)、设置(单个或批量)文件的日期时间(文件修改时间、文件访问时间、文件创建时间)。

帮助信息:
FileTimeTool --- Get/Set files' date & time

Usage:
  1.Get and display files' date & time:
      FileTime mode filespec [filespec ...]
    where mode:
              g=Get and display file all 3 date & time
              gw=Get and display file last write time
              ga=Get and display file last access time
              gc=Get and display file creation time
       filespec: filename (may include * or ?)
  2.Set files' date & time:
      FileTime mode date time filespec [filespec ...]
    where mode:
              sw=Set last write(modification) time
              sa=Set last access time
              sc=Set creation time
       date: yyyy-mm-dd format
       time: hh:mm:ss[.uuu] format, " " or 0 for 00:00:00
       filespec: filename (may include * or ?)
  3.Set files' date & time from a text file (above function 1 output format):
      FileTime sf file_time_list_text_file

Windows下获取文件时间的效果:
C:\Windows> FileTimeTool g *
Modification time       Last access time        Creation time           FileName
----------------------- ----------------------- ----------------------- --------
2004-08-17 20:00:00.000 2011-03-24 00:14:54.078 2011-02-21 20:48:15.671 Blue Lace 16.bmp
2004-08-17 20:00:00.000 2011-02-22 09:26:20.890 2004-08-17 20:00:00.000 clock.avi
1998-06-02 12:44:36.000 2011-07-13 11:35:08.703 2011-02-22 13:52:09.280 clspack.exe
2004-08-17 20:00:00.000 2011-03-24 00:14:54.093 2011-02-21 20:48:15.828 Coffee Bean.bmp
2011-02-21 20:52:17.093 2011-02-21 20:52:17.093 2011-02-21 20:52:17.093 control.ini
2004-08-17 20:00:00.000 2011-05-05 17:45:25.656 2004-08-17 20:00:00.000 explorer.scf
1998-06-02 12:05:28.000 2011-07-13 11:35:09.078 2011-02-22 13:52:08.687 extrac32.exe
......

Unix下获取文件时间的效果:
[/usr/include]$ ftt g *
Modification time   Last access time    Creation time       FileName
------------------- ------------------- ------------------- --------------------
2002-03-20 12:36:02 2009-07-07 13:08:52 2007-05-30 21:12:02 Judy.h
2007-02-09 19:33:04 2009-07-07 13:08:52 2007-05-31 11:51:43 a.out.h
2000-11-14 16:00:00 2009-07-07 13:08:52 2007-05-30 21:06:27 acl.h
2000-11-14 16:00:00 2009-07-07 13:08:52 2007-05-30 21:06:27 acllib.h
2000-11-14 16:00:00 2009-07-07 13:08:52 2007-05-30 21:06:27 aclv.h
2000-11-14 16:00:00 2009-07-07 13:08:52 2007-05-30 21:06:27 aio.h
2000-11-14 16:00:00 2009-07-07 13:08:52 2007-05-30 21:06:27 alloca.h
2007-02-09 19:33:04 2009-07-07 13:08:52 2007-05-31 11:51:43 aouthdr.h
2007-02-09 19:33:04 2009-07-07 13:08:52 2007-05-31 11:51:43 aouttypes.h
2000-11-14 16:00:00 2009-07-07 13:08:52 2007-05-30 21:06:01 api_macros.h
2000-11-14 16:00:00 2009-07-07 13:08:52 2007-05-30 21:06:01 api_trace.h
2007-02-09 19:33:05 2009-07-07 13:08:52 2007-05-31 11:51:43 ar.h
2000-11-14 16:00:00 2009-07-07 13:08:52 2007-05-30 21:06:27 assert.h
2000-11-14 16:00:00 2009-07-07 13:08:52 2007-05-30 21:06:30 bootpent.h
2000-11-14 16:00:00 2009-07-07 13:08:52 2007-05-30 21:06:27 bsdtty.h
......

论坛徽章:
0
2 [报告]
发表于 2011-07-13 13:08 |只看该作者
轮子{:3_182:}

论坛徽章:
0
3 [报告]
发表于 2011-07-13 16:13 |只看该作者
确实是轮子
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP