delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/06/06/09:45:04

From: Waldemar Schultz <schultz AT ma DOT tum DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Changing file protections
Date: Wed, 06 Jun 2001 12:23:21 +0200
Organization: [posted via] Leibniz-Rechenzentrum, Muenchen (Germany)
Lines: 27
Message-ID: <3B1E0499.B9AA84AD@ma.tum.de>
References: <3B17629C DOT B7A62B67 AT lps DOT u-psud DOT fr> <2593-Fri01Jun2001140424+0300-eliz AT is DOT elta DOT co DOT il> <3B17A982 DOT 5D9BC569 AT lps DOT u-psud DOT fr> <8011-Fri01Jun2001192208+0300-eliz AT is DOT elta DOT co DOT il> <3B1CB3AA DOT A109BEE9 AT ma DOT tum DOT de> <2110-Tue05Jun2001204901+0300-eliz AT is DOT elta DOT co DOT il>
NNTP-Posting-Host: pcritter14.mathematik.tu-muenchen.de
Mime-Version: 1.0
X-Trace: wsc10.lrz-muenchen.de 991823001 5196 131.159.68.151 (6 Jun 2001 10:23:21 GMT)
X-Complaints-To: news AT lrz-muenchen DOT de
NNTP-Posting-Date: 6 Jun 2001 10:23:21 GMT
X-Mailer: Mozilla 4.77 [en] (Win98; U)
X-Accept-Language: de,en-US
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Eli Zaretskii wrote:
> _chmod (and thus also chmod) works on directories as well; you can
> change the read-only, system, and hidden attributes of a directory.
> Note that DOS ignores the read-only attribute of a directory (e.g.,
> rmdir will still nuke it), but ported Posix programs which look at the
> write bit will honor it anyway.
> 
> As for the time stamp of a directory, DOS doesn't let you change that.
> The date and time of a directory are determined by DOS when the
> directory is first created, and thereafter never change.  All DOS
> functions which set data and time of files, including the functions
> from the LFN API, want a file handle, and since you cannot open a
> directory to get a handle, you cannot change the time stamp via DOS.
> The only possibility to work around this is to access the disk on the
> sector level with BIOS calls or Int 26h, but that's hardly worth the
> hassle.

Thanks for clarifying this. I misinterpreted the sentence about
directory and volume attributes in info alfa libc _chmod:
                                                          Note that the
directory and volume attribute bits must always be 0 when `_chmod()' is
called with FUNC = 1, or else the call will fail.

-- 
 Gruss Waldemar Schultz.         schultz AT ma DOT tum DOT de
 Technische Universität München, Zentrum Mathematik M1, D 80290 München
 Tel: +49 (0)89 2892 8226        FAX: +49 (0)89 2892 8228

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019