Permissions get lost when moving files between drives.

Dave Korn dk@artimi.com
Thu Jan 15 17:38:00 GMT 2004


 
> -----Original Message-----
> From: cygwin-owner@cygwin.com 
> [mailto:cygwin-owner@cygwin.com] On Behalf Of Igor Pechtchanski

> On Thu, 15 Jan 2004, Ronald Fischer wrote:
> 
> > I'm using cygwin bash on a Windows 2000 machine. When I perform the 
> > following steps (c: is the local drive, h: is a network 
> drive, which 
> > is also my $HOME):
> >
> > cd c:/
> > echo xxx >h:/tmp/x
> > mv h:/tmp/x y
> >
> > then a
> >
> >   ls -l
> >
> > shows that c:/y has the permissions set to 000, though h:/tmp/x has 
> > them correct as 644.
> >
> > Ronald

> At a guess, your C: drive is a FAT (or, worse yet, FAT32) 
> drive.  The cygcheck output mentioned at the above link will 
> show whether this is the case.
> 	Igor


  Nope, it's more complicated than that.  Here on my system I've got cygwin
root installed on an NTFS partition (under XP), and /win/t is a mountpoint
for the dos path T:\ which is a samba share from a linux box....  Now watch:

---snip---
dk@mace /> echo helloworld >testfile
dk@mace /> ls -la testfile
-rw-r--r--    1 dk       Domain U       11 Jan 15 17:12 testfile
dk@mace /> echo helloworld >/win/t/testfile2
dk@mace /> ls -la /win/t/testfile2
-rw-r--r--    1 dk       Domain U       11 Jan 15  2004 /win/t/testfile2
dk@mace /> cp /win/t/testfile2 ./testfile2a
dk@mace /> mv /win/t/testfile2 ./testfile2b
dk@mace /> ls -la testfile*
-rw-r--r--    1 dk       Domain U       11 Jan 15 17:12 testfile
-rw-r--r--    1 dk       Domain U       11 Jan 15 17:12 testfile2a
-rwx------+   1 dk       Domain U       11 Jan 15  2004 testfile2b
dk@mace />
---snip---

  So, I observe that:

A) it's not to do with OP's use of dos paths with drive letters and colons
B) it's not to do with FAT-vs-NTFS
C) it's not always 000 that the perms get set to, for me it's 700
D) it happens with cp but not with mv
E) something funny seems to occur with the c/m/a timestamps as well.

  Of those three, D) should give a big clue if anyone's familiar with the
different internals of those two commands...

   cheers, 
     DaveK





--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list