Questions tagged [filemtime]

File Modification Time, also known as mtime. On a UNIX filesystem, concepts similar to mtime include atime (access time) and ctime (metadata change time).

143 questions
0
votes
1 answer

How to preserve file mtime when uploading with Python ftplib

I am working on a Python tool to synchronize files between my local machines and a remote server. When I upload a file to the server the modification time property of that file on the server is set to the time of the upload process and not to the…
atarax42
  • 13
  • 8
0
votes
1 answer

calculate in TB total used disk space by files newer than X days using find

I have a folder with thousands of large files and I would like to find the total used disk space that was created in the last X days. I've tried this command: find . -type f -mtime -30 -printf '%s\n' | awk '{total=total+$1}END{print total/1024}' As…
yarone
  • 111
  • 3
0
votes
1 answer

filemtime is returning garbage values in php

I am working on a php code as shown below: $src_dir = ('\\\INVEST-ST-001\test\podcast\incoming_folder'); $mp4_files = preg_grep('~\.(mp4)$~', scandir($src_dir)); $file = $mp4_files[$key]; print_r($file); // Line A …
flash
  • 1,455
  • 11
  • 61
  • 132
0
votes
0 answers

display modified date and time of all files from a directory in php

I am working on a php code as shown below in which I want to display modified date and time of all files from a directory(outgoing_folder). $destination = 'outgoing_folder'; $mp3_files = preg_grep('/^([^.])/', scandir($destination)); /* Line#Z…
flash
  • 1,455
  • 11
  • 61
  • 132
0
votes
0 answers

PHP - filemtime(): stat failed for

I worte an api where I need to check if file is not older than 5 seconds before download. I think it might be problem with routing but it throws: "Warning: filemtime(): stat failed for {req}" and $req should be my .csv file in specific…
develops
  • 279
  • 1
  • 5
  • 14
0
votes
1 answer

Time logic for retrieving new XML contents - advice needed

I'm trying to cache the contents of an XML file, so that only one request per day to the external server is required. Basically, if the locally created XML file is more than a day old, to get the external contents and replace the contents of the…
Lee
  • 4,187
  • 6
  • 25
  • 71
0
votes
2 answers

Controlling cache on a cookie free domain

My situation I am following the advice of Yahoo's YSlow and I would like to store my static content on a subdomain. However, I would like to use the function filemtime() to control the cache of the files. The problem The problem is that this…
Michiel Pater
  • 22,377
  • 5
  • 43
  • 57
0
votes
0 answers

Linux -mtime not working as supposed to

In RedHat I have a script with the following line: find /oracle/app/oracle/diag/tnslsnr/listener/alert -name 'log_*' -mtime +5 -exec rm -f {} \; It supposed to remove files 'log_*' which are older then 5 days, but it removes also files which are…
Jack
  • 19
  • 4
0
votes
1 answer

How to compare mtime of symbolic links in bash?

In bash, one can test whether file1 is older than file2: if [[ file1 -ot file2 ]]; then ... fi If file1 or file2 (or both) are symbolic links, I want files compared by mtime of symbolic link itself, not the file it points to (i.e. I want…
0
votes
1 answer

Update timestamp of a directory on Windows

There is more or less well-known command line way to update the modification time of a file on Windows (described at Update file or folder Date Modified, for example): copy /b somePath\fileName+,, somePath\ According to my experience it does for a…
Alexander Samoylov
  • 2,358
  • 2
  • 25
  • 28
0
votes
1 answer

Linux Find command using +mtime gives incorrect results

I am using find to list files older than 21 days so they can be moved or deleted. I have a list of 80 files with dates ranging from 28/12/2017 to 11/01/2017 If I issue the command find . -maxdepth 1 -name '*.ABC*' -type f -mtime +7 -rw-r--r--…
phacebass
  • 11
  • 2
0
votes
3 answers

Why does home_url() not work with filemtime() in WordPress?

I wanted to start automatically changing my enqueue version so I don't have to manually change it after a file edit so I thought about using filemtime() to pull the time but for some reason when I use it with site_url() or home_url it doesn't…
DᴀʀᴛʜVᴀᴅᴇʀ
  • 7,681
  • 17
  • 73
  • 127
0
votes
3 answers

Filemtime giving the wrong output

I have no idea why filetime is giving me the wrong date. Anyone have any suggestions? for($i=0;$i<$image_count;$i++){ //Setup file names and file types $temp_name = $target_dir .…
David Jack
  • 87
  • 6
0
votes
1 answer

find command with daystart and mmin

How is find daystart used with mmin? daystart with mtime makes perfect sense, But with mmin its confusing. Let me explain what I do not get: find path -daysart -mtime 0 gives files modified today. find path -daystart -mtime 1 gives files modified…
Naren
  • 49
  • 1
  • 8
0
votes
2 answers

usort by creation date not working

I am trying to show images on my website with php usort, so the new images should be at the top and the oldest at the bottom. I tried to use usort, but it is not working and the images are still displayed the opposite way, the old ones are at the…
user7176800
  • 29
  • 1
  • 7