This is the mail archive of the cygwin@sourceware.cygnus.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: File permissions?


I had a similar problem when I tried building RCS. The -M
option on 'co' which restores the last modification time 
failed. I tracked through the implementation of 'utime()'
in 'cygwin.dll' (in winsup/times.cc). It uses calls
the Win32 SetFileTime() function to modify the file time.
SetFileTime needs a handle with a *write* lock on the
file whose time is being modified. So... if the file
is read only, the call to utime() fails because the 
implementation cannot get the write lock that it needs
to modify the time.

My work around in RCS was to alter the order in which
the modification time and the the final file mode were
set so that the file was still writeable when utime was
called.

Hope this helps.

Regards

Stuart Williams.


Sergey Okhapkin wrote:
> 
> Hmmmz wrote:
> >
> > Whenever I extract a tarfile that apparently changes the default
> > permissions on a file i get an error like so:
> >
> > tar: Could not change access and modification times of
> > readline-2.1/support: Permission denied
> >
> > I have gotten this on Win95 (vfat) Win95 OSR2 (fat32) and NT4 (ntfs)
> > running as administrator on NT.
> >
> 
> It seems to me, it's impossible to change timestamps of directories on win32...
> 
> --
> Sergey Okhapkin, http://www.lexa.ru/sos
> Moscow, Russia
> Looking for a job.
> 
> -
> For help on using this list (especially unsubscribing), send a message to
> "gnu-win32-request@cygnus.com" with one line of text: "help".
begin:          vcard
fn:             Stuart Williams
n:              Williams;Stuart
org:            Hewlett-Packard Laboratories
adr:            Hewlett-Packard Laboratories;;Filtion Road, ;Stoke Gifford,;Bristol;BS12 6QZ;UK
email;internet: skw@hplb.hpl.hp.com
tel;work:       +44 1179 228285
tel;fax:        +44 1179 229286
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
end:            vcard


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