Directory ctimes

Jim Hague hague at
Wed Feb 11 03:49:21 GMT 1998

We have an opportunity here to turn a WinNT machine into a Linux machine.

The machine will be used as a file server for developers mostly using VC++.
Unfortunately, last time I tried, VC++ makefiles don't work properly on
Samba. Everything gets recompiled on a make.

The reason as far as I can see is that the makefiles include the object
directory as a dependency for each object file. The directory is thus
created if it does not exist, but is otherwise untouched; NMAKE (gag -
spit) seems to be specially hacked to regard the time of a directory as the
creation time.

Unix time semantics here don't exactly match Win32, so Samba reports the
ctime as the creation time, which is fair enough. Unfortunately, when an
object file is written (and I think they are deleted and recreated if they
exist) the directory ctime is altered. The directory ctime is thence always
the time of the last object file write, so the dependency rule means NMAKE
will always rebuild everything :-(

Replacing NMAKE isn't an option for us, so I am proposing to add an option
to smb.conf to determine how directory creation times are reported. This
could be:

1. ctime, as at present (default).
2. earliest ctime of the files in the directory, or ctime if empty.
   (Prob. too expensive).
3. 1/1/70 or some other specified time.

Before I lurch off into this, has anybody else already dealt with this? Or
worked around it somehow? If not, any comments on further options and
possible nasty side-effects?
Jim Hague - hague at,bears at
Canon Information Systems Research Australia        +61 2 9805 2854

More information about the samba mailing list