Preserve date when cp over smbfs

Gilbert Cao hika at bsdmon.com
Wed Dec 28 14:38:15 PST 2005


Hi,

On Wed, Dec 28, 2005 at 10:53:53PM +0100, Martin P. Hansen wrote:
> On Wed, 28 Dec 2005, Gilbert Cao wrote:
> > 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 :
> 
> I've had this problem too, cp was also emitting a warning about utimes:
> 
> mph# mount -t smbfs -o-Eiso8859-1:cp850,-f660 //mph at light/e$ /mnt
> mph% cp -p INFO /mnt
> cp: utimes: /mnt/INFO: Operation not permitted

I don't have this warning when copying files.
All my mount directories are owned by my current (the one who does the
copy)

> 
> This was because I wasn't ``owner'' of the files. Adding the -u flag fixed this.

so, according to the mount_smbfs(8), the -u flag is not needed in my
case.

> 
> mph# mount -t smbfs -o-Eiso8859-1:cp850,-f660,-umph //mph at light/e$ /mnt
> 
> Now my modification time is preserved.

The problem still persists in my case :
My samba server is a FreeBSD machine (//mph at light/e$ <- I guess it is a
Windows machine)

But I still don't know why modification time is preserved when copying
with gqview ...

-- 
--------------------------------
 (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
--------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20051228/ac411290/attachment.bin


More information about the freebsd-questions mailing list