This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Cygwin chmod no work in ClearCase WinNT view


More information about the problem which may help diagnose it.

> >If I go into my ClearCase view:
> >      `cd v:`
> >then copy a VOB element to another file and change the 
> permissions on it:
> >      `cp file1 file2`
> >      `chmod 777 file2`     (file1, a CLearCase VOB element 
> has permissions of 444)
> >I am unable to append to or touch that file.
> >        `cat file1 >> file2`
> >        `touch file2`
> >bash: file2: Permission denied
> >
> >I think the problem is that Cygwin's `cp` command is not 
> copying as well as the DOS
> >`copy` command or that Cygwin's `chmod` command is not doing 
> everything that it could
> >be doing.

Okay, so I tried it (I use ClearCase) and have the following results.

You can copy a clearcase file (mode 444) to another filename and do
chmod till you are blue in the face, this appears to indeed remove the
readonly flag as seen with attrib but the file is still read only.  If
you copy this new file (mode 644, chmod 777 did not make it 777... I
use nontsec) to another file then you CAN append to that new file just
fine.  It looks like this.

cp file1 file2
chmod 777 file2
cat file1 >> file2: permission denied
attrib file2 (indicates NOT readonly)
cp file2 file3
cat file1 >> file3 (works fine)

Also note that if you vi (cygwin default vi) file2 and do ":w" it says
"Can't open file for writing. Press RETURN to continue".  Any
subsequent attempt to write the file succeeds.  From then on the cat
file1 >> file2 works as expected.

So interesting thing is that vi is doing something which makes the
file behave properly which chmod is not.  This may be a problem with
the MVFS filesystem ClearCase uses on Windows.  This idea is further
bolstered by the fact this problem does not occur using ClearCase
snapshot views which reside on a regular NTFS/FAT filesystem on
Windows.  I don't know what that bit vi is doing, but perhaps it is
just the act of opening the file and closing it?

Another interesting bit is this sequence works fine.

cp file1 file2
attrib -R file2
cat file1 >> file2

Here we've done the attrib -R instead of chmod 777 and it works fine
on MVFS.  Hope this helps.

Brian
-- 
Brian Jones <cbj@gnu.org>

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]