Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Dec 2005 12:25:58 +0100
From:      Gilbert Cao <hika@bsdmon.com>
To:        freebsd-questions@freebsd.org
Subject:   Preserve date when cp over smbfs
Message-ID:  <20051228112558.GA79302@bsdmon.com>

next in thread | raw e-mail | index | archive | help

--vkogqOf2sHV7VnPd
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi, the list.

I have noticed some small problem when copying files over SMB.
My samba server (port version 3.0.8,1) is running on a FreeBSD 5.4
STABLE.
My samba client is running on a FreeBSD 6.0 STABLE.

When I copy a single file with the cp utility, with -p flag, to
a smbfs mounted directory, the modification datetime is not preserved and it
is set to the current datetime :
$ cp -p myfile /path/to/smbmountdir/

The same thing occurred with the tar utility :
$ tar cpf - myfile | tar xpvf - -C /path/to/smbmountdir/

However, I have tried to copy the same file to the same smbfs mounted
directory, with gqview (port version 2.0.1_1) and the modification datetime=
 is preserved.

I have quickly looked into the source code of both cp and gqview, and it se=
ems
that cp relies on utimes(), and gqview relies on utime().

Is there any other way for the cp and tar utilities to preserve file
datetime over SMB ?
In the problem comes from the smbfs kernel module ? or the cp and tar
utility ?

In the future, I would just like to avoid loading gqview, just to copy
files with preserve datetime :
cp and tar seems more natural :p

Regards.

--=20
--------------------------------
 (hika) Gilbert Cao
 http://www.miaouirc.com
  - MiaouIRC Project 2002-2003
 http://www.bsdmon.com
  - The BSD DMON Power to serve
 IRC : #miaule at IRCNET Network
--------------------------------

--vkogqOf2sHV7VnPd
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (FreeBSD)

iD8DBQFDsnZGSyQfFTqAEpcRAj+SAJ48oy88trP35utqpGO98LwFB++mdACeLVnF
GCwV8g9u8TvR+Sk1TIqFrVo=
=WiJI
-----END PGP SIGNATURE-----

--vkogqOf2sHV7VnPd--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051228112558.GA79302>