Mail Archives: djgpp/2001/06/05/16:04:43
> From: Waldemar Schultz <schultz AT ma DOT tum DOT de>
> 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.
- Raw text -