diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2001-11-13 21:49:06 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2001-11-13 21:49:06 +0000 |
commit | 03adcc0fda221ca636b5fe71547cde0a0737161b (patch) | |
tree | c850a2256759b6a1a2c38922c1f6e3871ac4176e /winsup/cygwin/fhandler.cc | |
parent | 7a43fd8be112c2a94b3b7f06a28ce54ba931dbb2 (diff) | |
download | cygnal-03adcc0fda221ca636b5fe71547cde0a0737161b.tar.gz cygnal-03adcc0fda221ca636b5fe71547cde0a0737161b.tar.bz2 cygnal-03adcc0fda221ca636b5fe71547cde0a0737161b.zip |
* 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.
Diffstat (limited to 'winsup/cygwin/fhandler.cc')
-rw-r--r-- | winsup/cygwin/fhandler.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 510c7250d..9a177bd6e 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -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. */ |