Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2001-11-14 00:49:06 +0300
committerCorinna Vinschen <corinna@vinschen.de>2001-11-14 00:49:06 +0300
commit03adcc0fda221ca636b5fe71547cde0a0737161b (patch)
treec850a2256759b6a1a2c38922c1f6e3871ac4176e /winsup/cygwin/fhandler.cc
parent7a43fd8be112c2a94b3b7f06a28ce54ba931dbb2 (diff)
* 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.cc9
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. */