* dir.cc (mkdir): Add HIDDEN file attribute if file has leading dot

and HIDDEN_DOT_FILES is defined.
	* fhandler.cc (fhandler_base::open): Ditto.
	* path.cc (symlink): Ditto.
	* syscalls.cc (_rename): Ditto and remove HIDDEN file attribute if
	new filename does not begin with a dot.
This commit is contained in:
Corinna Vinschen
2001-11-13 21:49:06 +00:00
parent 7a43fd8be1
commit 03adcc0fda
5 changed files with 45 additions and 6 deletions

View File

@ -371,6 +371,15 @@ fhandler_base::open (path_conv *, int flags, mode_t mode)
if (get_device () == FH_SERIAL)
file_attributes |= FILE_FLAG_OVERLAPPED;
#ifdef HIDDEN_DOT_FILES
if (flags & O_CREAT && get_device () == FH_DISK)
{
char *c = strrchr (get_win32_name (), '\\');
if ((c && c[1] == '.') || *get_win32_name () == '.')
file_attributes |= FILE_ATTRIBUTE_HIDDEN;
}
#endif
/* CreateFile() with dwDesiredAccess == 0 when called on remote
share returns some handle, even if file doesn't exist. This code
works around this bug. */