LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-13-2018, 09:11 AM   #1
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Different file modification time display in directory listing


In a directory I have 2 files, which are modified at the same time.
Code:
-rw-r--r-- 1 jlinkels users 18280448 Aug 13 12:15 volksmusic_pur_1534161377-1534162517.mp3
-rw-r--r-- 1 jlinkels users 23220224 Aug 13  2018 orf_salzburg_1534161377-1534162517.mp3
One is displayed with the data Aug 13 12:15 and the other one Aug 13 2018. As far as I know, the ls -l command displays a time when the file is less than a year old. And a year when it is older.

Now the files are a result of storing an mplayer stream. Two files, so two mplayer streams, which are identical except for the URL they are playing.

There is a script running which monitors the file growth. Every 20 seconds or so the script checks the increase in file size. If this is satisfactory, the file is renamed. The second number in the file name is updated to the current time stamp.

Mplayer does not care about the changed file name. Internally mplayer uses a file handle, not the file name.

I have seen more often that both files being written had a time stamp displayed as Aug 13 2018. But all files which were not written anymore, just renamed one last time had a time stamp Aug 13 12:24. Or whatever the last modification date was.

But I just don't understand why 2 files being appended at the same time, and being renamed every 20 seconds have a different time stamp display each.

jlinkels
 
Old 08-13-2018, 09:30 AM   #2
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,735

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Curious...

Perhaps only the file still being updated doesn't have the hh:mm part?

Do all files which have had the last rename have the hh:mm part?

Edit: Perhaps related...
I was testing my printer connectivity to this Desktop by printing a page from SciTE. The page was unsaved...that is, there was no file.
At the top of printout, the actual date and time was printed: 8/03/2015 09:06:35 AM
At the bottom, the line: "File date: 12/31/1969 File time: 05:00:00 PM"
That appears to be the day before the Unix epoch date (not sure why the 5PM time, tho), which makes me think the time stamp might be "in process" if there is no file (or if the file is being updated)

Last edited by scasey; 08-13-2018 at 12:05 PM.
 
Old 08-13-2018, 08:09 PM   #3
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Original Poster
Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
As it seems, if the file rename is the last action, the Aug 13 20:23 is displayed. If the append is the last action the Aug 13 2018 is displayed.

Obviously, during appending usually the append action is last. What I saw was a hit by chance. On one file the directory was displayed after file rename and before the next append.

While the files are still being appended the Aug 13 2018 is displayed. Once appending has stopped and the last rename has happened the display is Aug 13 20:23.

The difference is of course that in one case the file changes (appending) in the other case the directory entry (file name) changes.

It is not that there is no time stamp or the date is set to the epoch at some moment. The time stamp seems OK, but the displayed format is off.

It still doesn't make sense. The display function should check if the last modification time is unambiguously less than a year ago. Regardless whether the file contents has changed. I am sure I miss some knowledge to understand this.

jlinkels
 
Old 08-13-2018, 08:11 PM   #4
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,837
Blog Entries: 1

Rep: Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071
Quote:
Originally Posted by jlinkels View Post
As far as I know, the ls -l command displays a time when the file is less than a year old. And a year when it is older.
It also displays only date when the timestamp is future, as can happen through an errant or intended difference in UTC offset amongst different source filesystems and local filesystem(s).
 
1 members found this post helpful.
Old 08-15-2018, 11:05 AM   #5
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Original Poster
Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
The recording process runs on a server. I can access the directory on the server and from a client over NFS.

The server and client both are set to UTC. The client is even time-synced to the server. So there can be no time difference, no time zone offset.

I just wanted to check if there was any difference between display when the directory is listed in the server shell or on the client over NFS. But today everything shows with the time, excluding the year. So Aug 15 16:05. Sigh.

jlinkels
 
Old 08-15-2018, 01:13 PM   #6
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,735

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
BTW, the hh:mm part of the display is replaced with the year if the file is more than six months old, not one year.
Code:
-rwxr-xr-x. 1 root root    25 Jan 29  2018 gabuse
-rwx------. 1 root root   338 Mar  3 20:19 melemail.sh
-rwx------. 1 root root   143 Jun 25 14:14 sal
-rwx------. 1 root root   380 Jul  7 17:54 b1ip.sh
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why does Samba display user number and not name when listing a remote directory. greenfloyd Linux - General 2 03-07-2016 09:09 AM
file last modification time archangel84 SUSE / openSUSE 2 10-12-2011 06:20 PM
file modification time graziano1968 Linux - Server 1 08-25-2008 09:06 AM
Fedora Core 8: apache not display directory listing and samba via smbclient can't see vuhuynh Linux - Newbie 1 02-29-2008 08:44 AM
long listing using ls -l command display year or time of the file mnd_world Linux - Newbie 1 05-20-2004 11:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration