Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
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).
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.
"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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.