Mark files starting with a dot as FA_HIDDEN.
Add configuration option 'ShowDotFiles' to turn this feature off.
This commit is contained in:
parent
27a91c782e
commit
14fb095758
|
@ -67,6 +67,7 @@ WINE REGISTRY Version 2
|
|||
; Enabling this may crash some programs that do recursive lookups of a whole
|
||||
; subdir tree in case of a symlink pointing back to itself.
|
||||
;"ShowDirSymlinks" = "1"
|
||||
;"ShowDotFiles" = "1"
|
||||
"ShellLinker" = "wineshelllink"
|
||||
|
||||
# <wineconf>
|
||||
|
|
|
@ -153,6 +153,15 @@ Tells Wine which graphics driver to use. Normally you'd want to use
|
|||
x11drv (for X11). In case you want to run programs as text console/TTY only
|
||||
without having Wine rely on X11 support, then use ttydrv.
|
||||
.PP
|
||||
.I format: """ShowDotFiles""=""<0|1>"""
|
||||
.br
|
||||
default: "0"
|
||||
.br
|
||||
Under Unix, files starting with a dot, are considered hidden,
|
||||
and should not be shown in directory listing (unless explicitly asked for),
|
||||
just like DOS-style hidden files. If you want them treated as regular
|
||||
files, set this value to 1.
|
||||
.PP
|
||||
.B [Version]
|
||||
.br
|
||||
.I format: """Windows""=""<version string>"""
|
||||
|
|
|
@ -800,8 +800,10 @@ are a logical @emph{or} of one or more of the following constants:
|
|||
The file is a read-only file. (Wine value: 0x0001).
|
||||
@end defvr
|
||||
@defvr_cw32 FILE_ATTRIBUTE_HIDDEN
|
||||
The file is a hidden file. Files in Wine do not have this attribute. (Wine value:
|
||||
0x0002).
|
||||
The file is a hidden file. Wine can set this attribute for files starting
|
||||
with a dot (normally considered hidden in a Unix environment). This behaviour
|
||||
is controlled by the @code{ShowDotFiles} configuration setting.
|
||||
(Wine value: 0x0002).
|
||||
@end defvr
|
||||
@defvr_cw32 FILE_ATTRIBUTE_SYSTEM
|
||||
The file belongs to the operating system. Files in Wine do not have this
|
||||
|
|
27
files/file.c
27
files/file.c
|
@ -735,14 +735,16 @@ static void FILE_FillInfo( struct stat *st, BY_HANDLE_FILE_INFORMATION *info )
|
|||
BOOL FILE_Stat( LPCSTR unixName, BY_HANDLE_FILE_INFORMATION *info )
|
||||
{
|
||||
struct stat st;
|
||||
int is_symlink;
|
||||
LPCSTR p;
|
||||
|
||||
if (lstat( unixName, &st ) == -1)
|
||||
{
|
||||
FILE_SetDosError();
|
||||
return FALSE;
|
||||
}
|
||||
if (!S_ISLNK(st.st_mode)) FILE_FillInfo( &st, info );
|
||||
else
|
||||
is_symlink = S_ISLNK(st.st_mode);
|
||||
if (is_symlink)
|
||||
{
|
||||
/* do a "real" stat to find out
|
||||
about the type of the symlink destination */
|
||||
|
@ -751,9 +753,26 @@ BOOL FILE_Stat( LPCSTR unixName, BY_HANDLE_FILE_INFORMATION *info )
|
|||
FILE_SetDosError();
|
||||
return FALSE;
|
||||
}
|
||||
FILE_FillInfo( &st, info );
|
||||
info->dwFileAttributes |= FILE_ATTRIBUTE_SYMLINK;
|
||||
}
|
||||
|
||||
/* fill in the information we gathered so far */
|
||||
FILE_FillInfo( &st, info );
|
||||
if (is_symlink) info->dwFileAttributes |= FILE_ATTRIBUTE_SYMLINK;
|
||||
|
||||
/* and now see if this is a hidden file, based on the name */
|
||||
p = strrchr( unixName, '/');
|
||||
p = p ? p + 1 : unixName;
|
||||
if (*p == '.' && *(p+1) && (*(p+1) != '.' || *(p+2)))
|
||||
{
|
||||
static const WCHAR wineW[] = {'w','i','n','e',0};
|
||||
static const WCHAR ShowDotFilesW[] = {'S','h','o','w','D','o','t','F','i','l','e','s',0};
|
||||
static int show_dot_files = -1;
|
||||
if (show_dot_files == -1)
|
||||
show_dot_files = PROFILE_GetWineIniBool(wineW, ShowDotFilesW, 0);
|
||||
if (!show_dot_files)
|
||||
info->dwFileAttributes |= FILE_ATTRIBUTE_HIDDEN;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue