When the hide_dot_files option is set, a file is marked hidden if the
first character in its name is a dot. This patch updates the hidden flag
when the file is renamed or hard linked (useful for text editors which
create files with a temporary 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);
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