diff --git a/libntfs-3g/dir.c b/libntfs-3g/dir.c index b0d50931..e015db9d 100644 --- a/libntfs-3g/dir.c +++ b/libntfs-3g/dir.c @@ -2075,6 +2075,15 @@ static int ntfs_link_i(ntfs_inode *ni, ntfs_inode *dir_ni, ntfschar *name, err = EOPNOTSUPP; goto err_out; } + if (NVolHideDotFiles(dir_ni->vol)) { + /* Set hidden flag according to the latest name */ + if ((name_len > 1) + && (name[0] == const_cpu_to_le16('.')) + && (name[1] != const_cpu_to_le16('.'))) + ni->flags |= FILE_ATTR_HIDDEN; + else + ni->flags &= ~FILE_ATTR_HIDDEN; + } /* Create FILE_NAME attribute. */ fn_len = sizeof(FILE_NAME_ATTR) + name_len * sizeof(ntfschar); diff --git a/src/ntfs-3g.8.in b/src/ntfs-3g.8.in index 9714ba16..bacb5925 100644 --- a/src/ntfs-3g.8.in +++ b/src/ntfs-3g.8.in @@ -227,6 +227,8 @@ Set the hidden flag in the NTFS attribute for created files and directories whose first character of the name is a dot. Such files and directories normally do not appear in directory listings, and when the flag is set they do not appear in Windows directory displays either. +When a file is renamed or linked with a new name, the hidden flag is +adjusted to the latest name. .TP .B windows_names This option prevents files, directories and extended attributes to be