Commit 14fb0957 authored by Dimitrie O. Paun's avatar Dimitrie O. Paun Committed by Alexandre Julliard

Mark files starting with a dot as FA_HIDDEN.

Add configuration option 'ShowDotFiles' to turn this feature off.
parent 27a91c78
...@@ -67,6 +67,7 @@ WINE REGISTRY Version 2 ...@@ -67,6 +67,7 @@ WINE REGISTRY Version 2
; Enabling this may crash some programs that do recursive lookups of a whole ; Enabling this may crash some programs that do recursive lookups of a whole
; subdir tree in case of a symlink pointing back to itself. ; subdir tree in case of a symlink pointing back to itself.
;"ShowDirSymlinks" = "1" ;"ShowDirSymlinks" = "1"
;"ShowDotFiles" = "1"
"ShellLinker" = "wineshelllink" "ShellLinker" = "wineshelllink"
# <wineconf> # <wineconf>
......
...@@ -153,6 +153,15 @@ Tells Wine which graphics driver to use. Normally you'd want to use ...@@ -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 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. without having Wine rely on X11 support, then use ttydrv.
.PP .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] .B [Version]
.br .br
.I format: """Windows""=""<version string>""" .I format: """Windows""=""<version string>"""
......
...@@ -800,8 +800,10 @@ are a logical @emph{or} of one or more of the following constants: ...@@ -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). The file is a read-only file. (Wine value: 0x0001).
@end defvr @end defvr
@defvr_cw32 FILE_ATTRIBUTE_HIDDEN @defvr_cw32 FILE_ATTRIBUTE_HIDDEN
The file is a hidden file. Files in Wine do not have this attribute. (Wine value: The file is a hidden file. Wine can set this attribute for files starting
0x0002). 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 @end defvr
@defvr_cw32 FILE_ATTRIBUTE_SYSTEM @defvr_cw32 FILE_ATTRIBUTE_SYSTEM
The file belongs to the operating system. Files in Wine do not have this The file belongs to the operating system. Files in Wine do not have this
......
...@@ -735,14 +735,16 @@ static void FILE_FillInfo( struct stat *st, BY_HANDLE_FILE_INFORMATION *info ) ...@@ -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 ) BOOL FILE_Stat( LPCSTR unixName, BY_HANDLE_FILE_INFORMATION *info )
{ {
struct stat st; struct stat st;
int is_symlink;
LPCSTR p;
if (lstat( unixName, &st ) == -1) if (lstat( unixName, &st ) == -1)
{ {
FILE_SetDosError(); FILE_SetDosError();
return FALSE; return FALSE;
} }
if (!S_ISLNK(st.st_mode)) FILE_FillInfo( &st, info ); is_symlink = S_ISLNK(st.st_mode);
else if (is_symlink)
{ {
/* do a "real" stat to find out /* do a "real" stat to find out
about the type of the symlink destination */ about the type of the symlink destination */
...@@ -751,9 +753,26 @@ BOOL FILE_Stat( LPCSTR unixName, BY_HANDLE_FILE_INFORMATION *info ) ...@@ -751,9 +753,26 @@ BOOL FILE_Stat( LPCSTR unixName, BY_HANDLE_FILE_INFORMATION *info )
FILE_SetDosError(); FILE_SetDosError();
return FALSE; 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; return TRUE;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment