as in Unix, you know that the creation time is marked as the creation time of the inode, while the m time (so called modification time) is also the time to the inode. (creation of inode happens when you first create file/directory), while the modification bit of the inode indicate add/removing content to a directory or changing the content of a file);
To get the mtime and ctime, you can use the time module together with the os.path module, here is the cdoe that best show how you can query some time stamp associated with a file.
import os.path, time
import exceptions
class TypeError (Exception):
pass
if __name__ == '__main__':
if (len(os.sys.argv) < 1):
raise TypeError()
else:
print "os.sys.argv[0]: %s" % os.sys.argv[0] # os.sys.argv[0] is the current file, in this case, file_ctime.py
f = os.sys.argv[0]
mtime = time.ctime(os.path.getmtime(f))
ctime = time.ctime(os.path.getctime(f))
print "Last modified : %s, last created time: %s" % (mtime, ctime)
分享到:
相关推荐
时间尺度修改(Time-Scale Modification, TSM)是指在不改变音频信号音调的前提下,对其播放速度进行加快或减慢的技术。在数字音乐制作领域,TSM已成为不可或缺的工具,并广泛集成到各种音乐制作软件中。由于音乐...
标题"Get-Windows-File-Info.zip_creation"暗示了我们关注的重点是获取文件的创建时间信息。在Windows系统中,每个文件都具有创建时间、修改时间和访问时间戳,这些元数据对于追踪文件的历史记录和进行文件管理非常...
formatted-task035-winogrande-question-modification-person.json
formatted-task034-winogrande-question-modification-object.json
### NEJM-T-CELL-Modification:Chimeric Antigen Receptor-Modified T Cells in Chronic Lymphoid Leukemia #### 概述 本研究通过基因转移技术设计了一种慢病毒载体,该载体能够表达一种针对B细胞抗原CD19的嵌合...
Search by Name - Extension - Date and time - Size in Bytes/KB/MB/GB/TB - Creation time - Modification time - Lower or equals and Higher or equals values Very faster search using the Smart File ...
* Description: This is the Sample code to show the usage of EDSDK. * * * * * ******************************************************************************* * * * Written and developed by Camera ...
7) If upgrading from a previous version of the Drag and Drop Component Suite, please read the document "upgrading_to_v4.txt" before you begin working on your existing projects. Note about "Property...
例如,Java中的`java.time.ZonedDateTime`和`java.time.LocalDateTime`,Python的`datetime`模块,或者C++的`chrono`库,它们都可以帮助开发者处理时区转换和DST问题。 对于批处理文件(如dst_test.bat),可能是在...
- 0000692: Runtime creation and modification of DBLookup components - 0000693: UniDBLookup bug - 0000695: UniDBGrid: Broken OnCellSelect in 0.82.0 0.82.0.803 +-------------------------------------...
-m, --modification-time don't extract file modified time --same-owner try extracting files with the same ownership --numeric-owner always use numbers for user/group names -p, --same-permissions ...
- USB printer: output file creation failure now causes a disconnect - re-implemented "options" parameter for additional options of connected devices (currently only used to set the speed reported ...
这个"z_bus_new.zip_Z-BUS_modification_z bus"压缩包显然涉及到对Z-BUS的修改或优化,可能是为了提高性能、增加功能或者适应新的硬件需求。 "z_bus_new.m"文件很可能是一个用MATLAB编写的脚本或函数,它可能包含了...
FtpModDate() - Determine modification time of file FtpSetCallback() - Establish a callback function FtpClearCallback() - Remove a callback function Server Connection FtpConnect() - Connect to a remote...
- **Book Overview**: "Python for Informatics" is a comprehensive guide designed to teach Python programming through the lens of data exploration and manipulation. This book is not just another ...
SiO2-TiO2复合泡沫陶瓷的表面蚀刻及其在聚苯乙烯加氢中的应用,韩凯悦,郭文泽,聚苯乙烯(PS)催化加氢制备氢化聚苯乙烯,又称作聚环己烷基乙烯,是一种重要的聚合物改性方法,可以提高PS的热稳定性以及光学稳定性
and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty...
- If a file does not extend beyond any of the original limitations (filesizes of 4 gig or 65535 files) then no Zip64 format information is included in the archive. - property isZip64 - tells you when ...