File Modification Time, also known as mtime. On a UNIX filesystem, concepts similar to mtime include atime (access time) and ctime (metadata change time).
Questions tagged [filemtime]
143 questions
1
vote
1 answer
How does os.stat(path).st_mtime actually get file modified time?
In this example, I'm using Python 3.6.5 installed using pyenv in an OSX shell.
I've been toying around with some proof of concept file watching code and I figured using a delta of a file's current and last measured st_mtime would be enough to…

Alex Milstead
- 83
- 1
- 8
1
vote
1 answer
What order does find(1) list files in?
On extfs, if there are only file-creations and no -deletions in a directory, I expect that find . -type f would list the files either in their chronological order of creation (or mtime), or if not, at least in their reverse chronological order...…

Harry
- 3,684
- 6
- 39
- 48
1
vote
1 answer
Warning: filemtime(): stat failed in line 49
I am trying to fix this part of the code as I am getting an error like this:
Warning: filemtime(): stat failed for /var/www/vhosts/example.tk/httpdocs/manager/css/general.css in /var/www/vhosts/example.tk/httpdocs/js-and-css.inc.php on line 49
…

Orkhan Orkhan
- 105
- 2
- 8
1
vote
2 answers
Sort files with filemtime
I have PHP file that generates gallery from a directory of images.
I want to sort images by modification date.
I'm trying to use filemtime function then sort function using the following code:

ramchi
- 13
- 3
1
vote
3 answers
PHP filemtime returns current date
I want to get modified date of the file that is uploaded but it returns current time (which I guess it's because filemtime returns modified date of temp file so long story short how can I get the true modified date?
here is my code it's (laravel…

mohammad
- 47
- 1
- 6
1
vote
1 answer
Delete a file if the timestamp is more than 20 minutes php
I am trying to delete a $lockfile if the timestamp is more than 20 minutes.
if (file_exists($lockfile) && time() - filemtime($lockfile) > strtotime("+20 minutes")) {
// If lockfile is alive for more than 20 minutes, unlink it
…

JavaJava21
- 51
- 1
- 6
1
vote
1 answer
How use filemtime with all link?
I would like to know, how use "filemtime" with all link ?
Example :
- My PHP file for get is : http://mywebsite.org/getdate.php
- The link that I want to get the date is : http://thegoodwebsite.net/i/banp.gif
Thanks in advance for your help!

Aymeric98
- 137
- 2
- 2
- 9
1
vote
0 answers
Python script must take a backup from recently modified directories but fails in reading mtime
I wrote the script below which checks the specified path PARENT_DIR and finds the recently modified directories (+subdirectories) then makes a back up of them into MOVE_DIR
The problem I'm struggling with is that, it seems this script, somehow,…

Sina Sh
- 1,177
- 3
- 15
- 24
1
vote
1 answer
IDL- Creating an array of mtimes of all of the files in a directory
So I'm trying to create a program that searches for the most recently updated file in a directory.
My initial hope was that a command like
file_array = FILE_INFO(file_path+'\*.dat')
would create an array of all of the files in the directory, and…

Brendan Battey
- 11
- 3
1
vote
2 answers
PHP - go to Next or Previous file in directory
We're making a portfolio with pages in a directory like:
/portfolio/a-company-name.php
/portfolio/another-company-name.php
/portfolio/yet-another-company-name.php
We want to build "next" and "previous" links on each page, where people can…

user1610904
- 397
- 3
- 20
1
vote
1 answer
PHP filemtime cache different day issue
I want to cache file for 5 minutes but filemtime with different day always return false, here the code

uingtea
- 6,002
- 2
- 26
- 40
1
vote
1 answer
how to transfer the mtime from one file to another
I'm using exifautotran to automatically reorient images imported from a camera. This script uses jpegtran to do the rotations, and this utility is not able to modify the original file. I need to preserve the mtime because I'm then matching the…

Robert Carter Mills
- 793
- 1
- 9
- 19
1
vote
3 answers
find files modified between two dates using php
I'm getting thoroughly confused about the various date functions and formats in php so I would like to ask for help if possible.
I'm trying to find files that were modified between two dates but the syntax is confusing me. For instance, if I tried…

user3713442
- 478
- 8
- 22
1
vote
2 answers
Restore modification times after vc operations
Make is purely timestamp-oriented: if a source is older than its target, the target gets rebuilt. This can cause long recompilations in big applications if one does some major version control detour.
Let me give you an example. Suppose I have an old…

MvG
- 57,380
- 22
- 148
- 276
1
vote
1 answer
Get mtime of a file with subsecond precision in ocaml (linux)
Ocaml's Unix module provides a stat function, which returns a record with a float st_mtime member.
This seems to always be second-level precision, even on Linux, which supports sub-second precision. The fact that it's a float and not an int gives me…

gfxmonk
- 8,614
- 5
- 42
- 53