| Author |
Message |
|
vlnrajesh
Joined: Thu Jan 28, 2010 17:17 Posts: 6
|
 Preserve Create time on NTFS
I need to preserve the Create time of a file when is been copied from Source NTFS to Destination NTFS partitions via a linux system.
Please help me in doing......
|
| Thu Jan 28, 2010 17:22 |
|
 |
|
jpa
NTFS-3G Lead Developer
Joined: Tue Sep 04, 2007 17:22 Posts: 1012
|
 Re: Preserve Create time on NTFS
Hi, Quote: I need to preserve the Create time of a file when is been copied from Source NTFS to Destination NTFS partitions via a linux system. Please help me in doing...... Please see http://www.tuxera.com/community/ntfs-3g ... #filetimesHowever there is a small bug in stable versions, you can use the latest advanced version from http://www.tuxera.com/community/ntfs-3g-advanced/ or wait till the fix makes through to the stable version. Regards Jean-Pierre
|
| Thu Jan 28, 2010 17:58 |
|
 |
|
vlnrajesh
Joined: Thu Jan 28, 2010 17:17 Posts: 6
|
 Re: Preserve Create time on NTFS
Hi Jean-Pierre,
I have installed the latest version ntfs-3g and mounted the ntfs partition with below command.
ntfsmount -o streams_interface=xattr,force /dev/sdb1 /root/mnt
Then, I am trying to get times of a file on target mount point. For that, using below command
getfattr -h -n system.ntfs_dos_name mnt/usplash-theme-ubuntu.c Results is "mnt/usplash-theme-ubuntu.c: system.ntfs_dos_name: No such attribute"
Please guide me to get and set filetimes of a file on ntfs partition.
Thanks in advance
Regards Rajesh
|
| Thu Jan 28, 2010 18:38 |
|
 |
|
jpa
NTFS-3G Lead Developer
Joined: Tue Sep 04, 2007 17:22 Posts: 1012
|
 Re: Preserve Create time on NTFS
Hi, Quote: Then, I am trying to get times of a file on target mount point. For that, using below command getfattr -h -n system.ntfs_dos_name mnt/usplash-theme-ubuntu.c Results is "mnt/usplash-theme-ubuntu.c: system.ntfs_dos_name: No such attribute" If you want to get times, why are you querying the dos name ? Apparently this file has no dos name (it was probably not written by Windows). To get the timestamps, do Code: getfattr -h -e hex -n system.ntfs_times mnt/usplash-theme-ubuntu.c Regards Jean-Pierre
|
| Thu Jan 28, 2010 20:32 |
|
 |
|
rajarun_3118
Joined: Thu Jan 28, 2010 20:00 Posts: 2
|
 Re: Preserve Create time on NTFS
I even tried to get timestamp of a file but it returns me array. Is there is any way to get all four attribute.
root@ubuntu:/# getfattr -h -e hex -n system.ntfs_times /mnt/dsdata/lan.log1 getfattr: Removing leading '/' from absolute path names # file: mnt/dsdata/lan.log1 system.ntfs_times=0x007e04de73a0ca01807cac1b6672ca0100c0750ac795ca01007e04de73a0ca01
The mail requirement is to set changetime
|
| Thu Jan 28, 2010 20:42 |
|
 |
|
rajarun_3118
Joined: Thu Jan 28, 2010 20:00 Posts: 2
|
 Re: Preserve Create time on NTFS
jpa wrote: Hi, Quote: Then, I am trying to get times of a file on target mount point. For that, using below command getfattr -h -n system.ntfs_dos_name mnt/usplash-theme-ubuntu.c Results is "mnt/usplash-theme-ubuntu.c: system.ntfs_dos_name: No such attribute" If you want to get times, why are you querying the dos name ? Apparently this file has no dos name (it was probably not written by Windows). To get the timestamps, do Code: getfattr -h -e hex -n system.ntfs_times mnt/usplash-theme-ubuntu.c Regards Jean-Pierre
|
| Thu Jan 28, 2010 21:49 |
|
 |
|
jpa
NTFS-3G Lead Developer
Joined: Tue Sep 04, 2007 17:22 Posts: 1012
|
 Re: Preserve Create time on NTFS
Hi, Quote: I even tried to get timestamp of a file but it returns me array. Is there is any way to get all four attribute. Well, you got all four timestamps.... Quote: The mail requirement is to set changetime Well, you just take the first eight bytes. For instance : Code: CREATIME=`getfattr -h -e hex -n system.ntfs_times <source> | \ grep '=' | sed -e 's/^.*=\(0x................\).*$/\1/'` setfattr -h -v $CREATIME -n system.ntfs_times <target> Regards Jean-Pierre
|
| Thu Jan 28, 2010 23:27 |
|
 |
|
vlnrajesh
Joined: Thu Jan 28, 2010 17:17 Posts: 6
|
 Re: Preserve Create time on NTFS
Things were working for me When ever I mount in windows, access time getting changed to a time of first visit(i.e, time of first accessing of file ) Regards, Rajesh
|
| Fri Jan 29, 2010 11:46 |
|
 |
|
jpa
NTFS-3G Lead Developer
Joined: Tue Sep 04, 2007 17:22 Posts: 1012
|
 Re: Preserve Create time on NTFS
Hi, Quote: When ever I mount in windows, access time getting changed to a time of first visit(i.e, time of first accessing of file ) I told you previously : Regards Jean-Pierre
|
| Fri Jan 29, 2010 13:01 |
|
|