LinuxQuestions.org
Help answer threads with 0 replies.
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-27-2018, 01:49 PM   #1
qrange
Senior Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable/testing, amd64
Posts: 1,061

Rep: Reputation: 47
ntfs-3g milliseconds lost


When I unpack .rar file onto ntfs(3g) mounted partition, it seems that milliseconds in 'Modify' timestamp are simply lost (cut off).
Is there a way to keep them?

thanks.
 
Old 08-27-2018, 02:38 PM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
So you're saying that you unpack them onto a type 83 file system and the timestamp retains milliseconds?

If so, unpack them on a Linux partition, and then copy them to the NTFS partition and see what happens. My suspicion is that the NTFS partition will not timestamp files using that level of precision.
 
1 members found this post helpful.
Old 08-27-2018, 04:35 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,699

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
If I understand timestamps, your question and what you are actually referring to then the answer is no. Otherwise you need to provide some additional information.

Your correct NTFS does not. I don't know how ntfs-3g handles timestamps. linux uses nanosecond time stamps but NTFS is only 100 nanosecond time stamp. To illustrate I created a text file on a ext4 filesystem and copied it to an external NTFS USB drive preserving time stamps. The fractional part of time was .274039542 versus 274039500.

Quote:
touch test.txt
stat ctime.txt

Access: 2018-08-27 15:43:29.274039542
Modify: 2018-08-27 15:43:29.274039542
Change: 2018-08-27 15:43:29.274039542

cp -p ctime.txt /media/goflex1/

stat test.txt

Access: 2018-08-27 15:43:29.274039500
Modify: 2018-08-27 15:43:29.274039500
Change: 2018-08-27 15:43:51.538605000
If you create a file on a NTFS filesystem it seems like the atime and mtime are to the nearest second but ctime is to the nearest 10 microseconds.

Quote:
/media/goflex1# touch text1.txt
/media/goflex1# stat text1.txt

Access: 2018-08-27 15:44:59.000000000
Modify: 2018-08-27 15:44:59.000000000
Change: 2018-08-27 15:44:59.529160000

https://docs.microsoft.com/en-us/win...nfo/file-times

Last edited by michaelk; 08-27-2018 at 04:40 PM.
 
1 members found this post helpful.
Old 08-28-2018, 01:34 AM   #4
qrange
Senior Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable/testing, amd64
Posts: 1,061

Original Poster
Rep: Reputation: 47
sorry, I was wrong. forget ntfs3g part.

I need to unpack a .rar file (that was created on Windows) onto ext4 partition and retain exact same timestamp, so that later I can re-pack it to identical .rar file (probably by using same rar version in wine).
 
Old 08-28-2018, 12:58 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,978

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
"KeepFileStamp=0" then??
 
Old 08-28-2018, 03:53 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,699

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
I forgot to ask what you meant about 'Modify' timestamp are simply lost (cut off).

jefro that got me thinking.

I am not familiar enough with winRAR but depending on version there appears to be an option to select high precision time format (100 ns time) when archiving files. If this is not set then I would assume the modification time to have less precision which is what I assumed you meant by cut off.

I would expect unpacking a file would maintain the same modification time with the same precision as the original file. If the file is unmodified then I would assume using the same version with the same options under wine to keep the same precision.
 
Old 08-31-2018, 03:30 PM   #7
qrange
Senior Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable/testing, amd64
Posts: 1,061

Original Poster
Rep: Reputation: 47
@jefro

"KeepFileStamp=0" (or 1) doesn't work for some reason.
I'm using ext4 with these options: /dev/sda1 on / type ext4 (rw,relatime,discard,commit=60,data=ordered)

Code:
1000@debian:~/vdi/vbox_shr/rartest$ rar lt rar500.rar 

RAR 5.40   Copyright (c) 1993-2016 Alexander Roshal   15 Aug 2016
Trial version             Type RAR -? for help

Archive: rar500.rar
Details: RAR 4

        Name: Rar500.exe
        Type: File
        Size: 488024
 Packed size: 230168
       Ratio: 47%
       mtime: 2013-08-22 19:01:18,235
  Attributes: ..A....
       CRC32: 98FD70D0
     Host OS: Windows
 Compression: RAR 3.0(v29) -m3 -md=512K

1000@debian:~/vdi/vbox_shr/rartest$ unrar x -KeepFileStamp=0  rar500.rar 

UNRAR 5.30 beta 2 freeware      Copyright (c) 1993-2015 Alexander Roshal


Extracting from rar500.rar

Extracting  Rar500.exe                                                OK 
All OK
1000@debian:~/vdi/vbox_shr/rartest$ ls -lan --time-style=full-iso
total 716
drwxr-xr-x  2 1000 1000   4096 2018-08-31 22:23:50.593784620 +0200 .
drwxr-xr-x 11 1000 1000   4096 2018-08-31 22:20:28.658761091 +0200 ..
-rw-r--r--  1 1000 1000 488024 2013-08-22 19:01:18.000000000 +0200 Rar500.exe
-rw-r--r--  1 1000 1000 230242 2018-08-31 22:20:55.882625587 +0200 rar500.rar
 
  


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
Lost NTFS partition slaka Linux - Newbie 1 10-19-2012 03:41 PM
Lost My NTFS Support! Wheat_Thins Linux - Newbie 1 12-01-2005 01:09 AM
Lost NTFS partition? Jongi SUSE / openSUSE 12 07-04-2005 09:21 AM
HELP PLEASE!!! Lost NTFS Partition frijj2k Linux - General 9 05-27-2005 10:44 AM
FC2 with XP - Lost my NTFS partition amrgo Linux - General 6 08-08-2004 08:49 AM

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

All times are GMT -5. The time now is 09:00 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