* 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

@@ -340,6 +340,11 @@ mkdir (const char *dir, mode_t mode)
if (!allow_ntsec && allow_ntea)
set_file_attribute (real_dir.has_acls (), real_dir.get_win32 (),
S_IFDIR | ((mode & 07777) & ~cygheap->umask));
#ifdef HIDDEN_DOT_FILES
char *c = strrchr (real_dir.get_win32 (), '\\');
if ((c && c[1] == '.') || *real_dir.get_win32 () == '.')
SetFileAttributes (real_dir.get_win32 (), FILE_ATTRIBUTE_HIDDEN);
#endif
res = 0;
}
else