* 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:
@@ -1240,7 +1240,16 @@ done:
|
||||
else
|
||||
{
|
||||
/* make the new file have the permissions of the old one */
|
||||
SetFileAttributes (real_new, real_old);
|
||||
DWORD attr = real_old;
|
||||
#ifdef HIDDEN_DOT_FILES
|
||||
char *c = strrchr (real_old.get_win32 (), '\\');
|
||||
if ((c && c[1] == '.') || *real_old.get_win32 () == '.')
|
||||
attr &= ~FILE_ATTRIBUTE_HIDDEN;
|
||||
c = strrchr (real_new.get_win32 (), '\\');
|
||||
if ((c && c[1] == '.') || *real_new.get_win32 () == '.')
|
||||
attr |= FILE_ATTRIBUTE_HIDDEN;
|
||||
#endif
|
||||
SetFileAttributes (real_new, attr);
|
||||
|
||||
/* Shortcut hack, No. 2, part 2 */
|
||||
/* if the new filename was an existing shortcut, remove it now if the
|
||||
|
Reference in New Issue
Block a user