在WindowsXP上从不同的Python版本计算得到两个不同的修改时间。Python2.4C:\Copyofelisp>c:\python24\pythonPython2.4.4(#71,Oct182006,08:34:43)[MSCv.131032bit(Intel)]onwin32Type"help","copyright","credits"or"license"formoreinformation.>>>importos>>>os.path.getmtime("auto-complete-emacs-lisp.el")1251684178>>>^ZPython2.6C:\Co
我有一个关于python的os.path.getmtime()函数的快速问题。我观察到一些奇怪的行为。我正在开发一个网络应用程序,它会定期检查某个文件是否已被修改,并根据该文件决定是否刷新。在我的本地python命令行中,当我更改文件并调用os.path.getmtime(file_name)时,mtime的返回值已更改以反射(reflect)更改在文件中。但是,当我在我的网络应用程序中调用os.path.getmtime()时,更改前后的返回值是相同的。我在网上做了一些研究,发现一些东西表明需要重新加载os模块才能注册对文件的更改。因此,在我的网络应用程序中,我重新加载了os模块,但
有人可以指定unix系统中os.path.getmtime(path)和os.path.getctime(path)有什么区别。根据python文档中的定义:os.path.getmtime(路径)Returnthetimeoflastmodificationofpath.Thereturnvalueisanumbergivingthenumberofsecondssincetheepoch(seethetimemodule).Raiseos.errorifthefiledoesnotexistorisinaccessible.os.path.getctime(path)Returnt