Date: Tue, 05 Jun 2001 20:49:02 +0300 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: Waldemar Schultz Message-Id: <2110-Tue05Jun2001204901+0300-eliz@is.elta.co.il> X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.9 CC: djgpp AT delorie DOT com In-reply-to: <3B1CB3AA.A109BEE9@ma.tum.de> (message from Waldemar Schultz on Tue, 05 Jun 2001 12:25:46 +0200) Subject: Re: Changing file protections 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> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: Waldemar Schultz > Newsgroups: comp.os.msdos.djgpp > Date: Tue, 05 Jun 2001 12:25:46 +0200 > > related question: > are there libc functions to change attributes / date > of _directories_ ? _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.