diff --git a/comp/src/gb.form/.src/File/Chooser/FDirChooser.class b/comp/src/gb.form/.src/File/Chooser/FDirChooser.class index a24eda2d4..e9ef94719 100644 --- a/comp/src/gb.form/.src/File/Chooser/FDirChooser.class +++ b/comp/src/gb.form/.src/File/Chooser/FDirChooser.class @@ -425,6 +425,9 @@ Public Sub SetPath(sPath As String) Dim sMsg As String If Not IsDir(File.Dir(sPath)) Then sMsg = ("Directory not found.") + + If File.IsHidden(sPath) Then SetShowHidden(True) + SetDir(File.Dir(sPath)) If Not GetMulti() Then diff --git a/main/gbx/gbx_c_file.c b/main/gbx/gbx_c_file.c index 9e92ca4d6..82bf56209 100644 --- a/main/gbx/gbx_c_file.c +++ b/main/gbx/gbx_c_file.c @@ -673,6 +673,25 @@ BEGIN_METHOD(File_IsRelative, GB_STRING path) END_METHOD +BEGIN_METHOD(File_IsHidden, GB_STRING path) + + char *path = STRING(path); + int len = LENGTH(path); + int i; + + for (i = 0; i < len; i++) + { + if (path[i] == '.' && (i == 0 || path[i - 1] == '/')) + { + GB_ReturnBoolean(TRUE); + return; + } + } + + GB_ReturnBoolean(FALSE); + +END_METHOD + //--------------------------------------------------------------------------- BEGIN_PROPERTY(Stream_Handle) @@ -910,6 +929,7 @@ GB_DESC NATIVE_File[] = GB_STATIC_METHOD("SetBaseName", "s", File_SetBaseName, "(Path)s(NewBaseName)s"), GB_STATIC_METHOD("IsRelative", "b", File_IsRelative, "(Path)s"), + GB_STATIC_METHOD("IsHidden", "b", File_IsHidden, "(Path)s"), GB_STATIC_METHOD("Load", "s", File_Load, "(FileName)s"), GB_STATIC_METHOD("Save", NULL, File_Save, "(FileName)s(Data)s"),