Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There are two methods to get the mod time, os.path.getmtime() or os.stat(), but the ctime is not reliable cross-platform (see below).</p> <h3><a href="http://www.python.org/doc/2.5.2/lib/module-os.path.html" rel="noreferrer">os.path.getmtime()</a></h3> <p><strong>getmtime</strong>(<em>path</em>)<br /> <em>Return the time of last modification of path. The return value is a number giving the number of seconds since the epoch (see the time module). Raise os.error if the file does not exist or is inaccessible. New in version 1.5.2. Changed in version 2.3: If os.stat_float_times() returns True, the result is a floating point number.</em></p> <h3><a href="http://www.python.org/doc/2.5.2/lib/os-file-dir.html" rel="noreferrer">os.stat()</a></h3> <p><strong>stat</strong>(<em>path</em>)<br /> <em>Perform a stat() system call on the given path. The return value is an object whose attributes correspond to the members of the stat structure, namely: st_mode (protection bits), st_ino (inode number), st_dev (device), st_nlink (number of hard links), st_uid (user ID of owner), st_gid (group ID of owner), st_size (size of file, in bytes), st_atime (time of most recent access), <strong>st_mtime</strong> (time of most recent content modification), <strong>st_ctime</strong> (platform dependent; time of most recent metadata change on Unix, or the time of creation on Windows)</em>:</p> <pre><code>&gt;&gt;&gt; import os &gt;&gt;&gt; statinfo = os.stat('somefile.txt') &gt;&gt;&gt; statinfo (33188, 422511L, 769L, 1, 1032, 100, 926L, 1105022698,1105022732, 1105022732) &gt;&gt;&gt; statinfo.st_size 926L &gt;&gt;&gt; </code></pre> <p>In the above example you would use statinfo.st_mtime or statinfo.st_ctime to get the mtime and ctime, respectively.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload