LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 06-06-2017, 09:47 AM   #1
kudsu
Member
 
Registered: Apr 2017
Location: from LA
Distribution: Slackware and anything
Posts: 50

Rep: Reputation: Disabled
Question A question about linux and windows time stamps


It is my experience that to move touch, work with a file in any way alters the time stamp on a file. Are there any ways to change the file stamp, maybe editing the file itself. And what record is left of the various edits. The logs, inode, changes on the disk, etc. I presume that you can't do this without numerous trails.

What about windoze 10 and before?

Thank you for your help.
 
Old 06-06-2017, 11:14 AM   #2
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 3,800

Rep: Reputation: 1725Reputation: 1725Reputation: 1725Reputation: 1725Reputation: 1725Reputation: 1725Reputation: 1725Reputation: 1725Reputation: 1725Reputation: 1725Reputation: 1725
Microsoft (windows) time stamps and Unix (Linux) time stamps are very different. ANY software (sftp clients, SMB/CIFS client, etc.) that must translate often get the translation wrong.

Linux has defined structures for Creation, Modification, and Access times. Some modern file systems no longer use or update Access times by default, only a few applications ever use them. Those that use them default to settings that reduce the number of writes to update or maintain that time stamp. The most useful one is Modification time, which records when the last change to the file occurred.

I have used and supported the use of many ftp and sftp clients. As of the last time I ran a week of testing: The only Windows client that has long gotten the translation correct is WinSCP. All of the others focus on the primary functions (file transfer) and do not worry about fixing the file time issues. This may have changed for some of them, but was true when I used them last.

I have not checked time stamps in SAMBA v4 since it hit release, and my tests on SAMBA 3 were so long ago I do not recall the result.

The point is, it may make a difference what software or application is reporting the time on the file TO you. Keep in mind what OS and application is setting and reporting, it may matter.

I hope that this information helps.
 
1 members found this post helpful.
Old 06-06-2017, 11:21 AM   #3
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 5,498
Blog Entries: 16

Rep: Reputation: 3261Reputation: 3261Reputation: 3261Reputation: 3261Reputation: 3261Reputation: 3261Reputation: 3261Reputation: 3261Reputation: 3261Reputation: 3261Reputation: 3261
In Linux, you can update the time stamp on a file by using the touch command. You don't need to actually edit it.

Most editors keep a backup of the most recent version. I found a script here for doing incremental backups with vim. I suppose it could be generalised to other editors.
 
Old 06-09-2017, 01:18 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 17,863

Rep: Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598
Actually, *nix does not have Creation time
Quote:
Three fields in the inode structure contain the last access, change, and modification times: atime, ctime, and mtime. The atime field is updated each time the pointer to the file's data blocks is followed and the file's data is read. The mtime field is updated each time the file's data changes. The ctime field is updated each time the file's inode changes. The ctime is not creation time; there is no way under standard Unix to find a file's creation time.
https://docstore.mik.ua/orelly/perl4/cook/ch09_01.htm

The ext4 filesystem theoretically has 'birth time', but afaik almost no utils actually populate it...
 
Old 06-09-2017, 03:51 AM   #5
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 16,505

Rep: Reputation: 5548Reputation: 5548Reputation: 5548Reputation: 5548Reputation: 5548Reputation: 5548Reputation: 5548Reputation: 5548Reputation: 5548Reputation: 5548Reputation: 5548
just a remark: this not about linux/windows/os, but about filesystems.
 
1 members found this post helpful.
Old 06-09-2017, 05:37 AM   #6
dave@burn-it.co.uk
Member
 
Registered: Sep 2011
Distribution: Puppy
Posts: 601

Rep: Reputation: 172Reputation: 172
Correct it is about file systems not OS. At that point the OS has no control.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Preserve time stamps of files on a linux based NAS acidrop Linux - Server 2 10-04-2013 05:21 AM
are linux date/time stamps correct? Trio3b Linux - General 4 11-18-2010 11:49 AM
LXer: Using Perl On Linux To Do Mass Synchronization Of File Time Stamps LXer Syndicated Linux News 0 05-27-2008 07:41 AM
Time stamps following move to British Summer Time aikempshall Linux - General 2 03-30-2007 08:30 AM

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

All times are GMT -5. The time now is 05:06 PM.

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