reversed default for showing/hiding hidden files

PERMISSION_HANDLING_BRANCH
Jean-Pierre André 2010-05-25 10:18:20 +02:00
parent ac070299ac
commit e3537c3376
3 changed files with 26 additions and 21 deletions

View File

@ -209,7 +209,7 @@ typedef struct {
ntfs_atime_t atime;
BOOL ro;
BOOL show_sys_files;
BOOL show_hid_files;
BOOL hide_hid_files;
BOOL hide_dot_files;
BOOL ignore_case;
BOOL windows_names;
@ -3654,8 +3654,13 @@ static int ntfs_open(const char *device)
ntfs_log_perror("Failed to mount '%s'", device);
goto err_out;
}
if (ntfs_set_shown_files(vol, ctx->show_sys_files,
ctx->show_hid_files, ctx->hide_dot_files))
#ifdef HAVE_SETXATTR
/* archivers must see hidden files */
if (ctx->efs_raw)
ctx->hide_hid_files = FALSE;
#endif
if (ntfs_set_shown_files(ctx->vol, ctx->show_sys_files,
!ctx->hide_hid_files, ctx->hide_dot_files))
goto err_out;
if (ctx->ignore_case && ntfs_set_ignore_case(vol))
@ -3824,10 +3829,10 @@ static char *parse_mount_options(const char *orig_opts)
if (bogus_option_value(val, "show_sys_files"))
goto err_exit;
ctx->show_sys_files = TRUE;
} else if (!strcmp(opt, "show_hid_files")) {
if (bogus_option_value(val, "show_hid_files"))
} else if (!strcmp(opt, "hide_hid_files")) {
if (bogus_option_value(val, "hide_hid_files"))
goto err_exit;
ctx->show_hid_files = TRUE;
ctx->hide_hid_files = TRUE;
} else if (!strcmp(opt, "hide_dot_files")) {
if (bogus_option_value(val, "hide_dot_files"))
goto err_exit;
@ -3949,8 +3954,6 @@ static char *parse_mount_options(const char *orig_opts)
if (bogus_option_value(val, "efs_raw"))
goto err_exit;
ctx->efs_raw = TRUE;
/* show hidden files to archivers */
ctx->show_hid_files = 1;
#endif /* HAVE_SETXATTR */
} else { /* Probably FUSE option. */
if (strappend(&ret, opt))

View File

@ -195,13 +195,12 @@ show_sys_files, all files are accessible by name, for example you can always
do
"ls \-l '$UpCase'".
.TP
.B show_hid_files
Show the hidden files and directories in directory listings, the hidden files
.B hide_hid_files
Hide the hidden files and directories in directory listings, the hidden files
and directories being the ones whose NTFS attribute have the hidden flag set.
This flag has no effect on files and directory whose first character of
the name is a dot. Furthermore, irrespectively of show_hid_files, all files
and directories are accessible by name, for example you can always display
the Windows trash bin directory by :
The hidden files will not be selected when using wildcards in commands,
but all files and directories remain accessible by full name, for example you
can always display the Windows trash bin directory by :
"ls \-ld '$RECYCLE.BIN'".
.TP
.B hide_dot_files

View File

@ -170,7 +170,7 @@ typedef struct {
ntfs_atime_t atime;
BOOL ro;
BOOL show_sys_files;
BOOL show_hid_files;
BOOL hide_hid_files;
BOOL hide_dot_files;
BOOL windows_names;
BOOL silent;
@ -3607,8 +3607,13 @@ static int ntfs_open(const char *device)
ntfs_log_perror("Failed to mount '%s'", device);
goto err_out;
}
#ifdef HAVE_SETXATTR
/* archivers must see hidden files */
if (ctx->efs_raw)
ctx->hide_hid_files = FALSE;
#endif
if (ntfs_set_shown_files(ctx->vol, ctx->show_sys_files,
ctx->show_hid_files, ctx->hide_dot_files))
!ctx->hide_hid_files, ctx->hide_dot_files))
goto err_out;
ctx->vol->free_clusters = ntfs_attr_get_free_bits(ctx->vol->lcnbmp_na);
@ -3774,10 +3779,10 @@ static char *parse_mount_options(const char *orig_opts)
if (bogus_option_value(val, "show_sys_files"))
goto err_exit;
ctx->show_sys_files = TRUE;
} else if (!strcmp(opt, "show_hid_files")) {
if (bogus_option_value(val, "show_hid_files"))
} else if (!strcmp(opt, "hide_hid_files")) {
if (bogus_option_value(val, "hide_hid_files"))
goto err_exit;
ctx->show_hid_files = TRUE;
ctx->hide_hid_files = TRUE;
} else if (!strcmp(opt, "hide_dot_files")) {
if (bogus_option_value(val, "hide_dot_files"))
goto err_exit;
@ -3897,8 +3902,6 @@ static char *parse_mount_options(const char *orig_opts)
if (bogus_option_value(val, "efs_raw"))
goto err_exit;
ctx->efs_raw = TRUE;
/* show hidden files to archivers */
ctx->show_hid_files = 1;
#endif /* HAVE_SETXATTR */
} else { /* Probably FUSE option. */
if (strappend(&ret, opt))