Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I did a quick test and got the results below. Whats with the horrible time resolution? Is there a way I can make it better?

creation
129971441605098285
mod
129971442166583272
a.ToFileTimeUtc()
129971442170000000
b.ToFileTimeUtc()
129971442170000000

The results of ToFileTimeUtc (which returns the number of 100ns ticks since Jan 1, 1601) show that the timestamps have been rounded to the nearest second, instead of being stored with their full precision.

I'm using Samba on Ubuntu. I grabbed the config file from somewhere. I'm transferring files to a NTFS filesystem mounted by linux over samba

[global]
netbios name = toltec
workgroup = METRAN
security = user
wins support = yes
preferred master = yes
os level = 65


[homes]
comment = %u's Home Directory
browsable = no
read only = no
share|improve this question
    
First off, we're not .Net programmers here. Having Googled it, it appears that 129971442170000000 is a count in 100ns ticks (WTF, Microsoft?), so 12997144217 seconds. But with a Jan 1 1601 epoch. So, basically, you're asking how to get better than 1-second resolution with Samba? –  derobert Nov 13 '12 at 17:26
    
Second, you need to tell us some detail about your Samba server. In particular, are you using ext3 or ext4 (or something else entirely)? Ext3 doesn't support subsecond timestamps. Ext4 does. –  derobert Nov 13 '12 at 17:31
    
@derobert: ah sorry. Ok so its actually worse then you think. I subtracted the date from 129971441605098285 and 129971442170000000 which got me a 56.49 seconds difference. Thats nearly a minute off –  acidzombie24 Nov 13 '12 at 19:39
    
Hmmm, is the clock on the server set correctly? –  derobert Nov 13 '12 at 19:47
    
@derobert: That doesn't exactly matter. Look at all those zeros. Also its a VM and the time is correct –  acidzombie24 Nov 13 '12 at 19:48
show 12 more comments

1 Answer 1

up vote 2 down vote accepted

From the long comment chain, it appears that ntfs-3g (or possibly FUSE) doesn't fully support 100ns timestamps, or at least the version in Ubuntu 12.04 does not. There are random forum threads that indicate FUSE 2.9 is required, but Ubuntu 12.04 has 2.8.

Ubuntu 12.10 does have FUSE 2.9, but its not a long-term support release. So you probably don't want to upgrade to it.

Another alternative would be to switch to a filesystem that supports high-resolution timestamps in Ubuntu 12.04, such as ext4. Unless you plan on disconnecting the disk from the Samba server and connecting it to a Windows machine, this is probably a better choice than NTFS anyway, especially if you enable extended attributes in Samba.

share|improve this answer
    
There isn't anything on it so i'll grab 12.10 and give it a try. –  acidzombie24 Nov 14 '12 at 19:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.