@@ -125,7 +125,7 @@ static int pgCompareString(const void *str1, const void *str2);
125125
126126static char dir_check_file (pgFile * file );
127127static void dir_list_file_internal (parray * files , pgFile * parent , bool exclude ,
128- bool follow_symlink ,
128+ bool follow_symlink , bool skip_hidden ,
129129 int external_dir_num , fio_location location );
130130static void opt_path_map (ConfigOption * opt , const char * arg ,
131131 TablespaceList * list , const char * type );
@@ -575,7 +575,7 @@ db_map_entry_free(void *entry)
575575 */
576576void
577577dir_list_file (parray * files , const char * root , bool exclude , bool follow_symlink ,
578- bool add_root , int external_dir_num , fio_location location )
578+ bool add_root , bool skip_hidden , int external_dir_num , fio_location location )
579579{
580580 pgFile * file ;
581581
@@ -601,7 +601,7 @@ dir_list_file(parray *files, const char *root, bool exclude, bool follow_symlink
601601 if (add_root )
602602 parray_append (files , file );
603603
604- dir_list_file_internal (files , file , exclude , follow_symlink ,
604+ dir_list_file_internal (files , file , exclude , follow_symlink , skip_hidden ,
605605 external_dir_num , location );
606606
607607 if (!add_root )
@@ -821,7 +821,7 @@ dir_check_file(pgFile *file)
821821 */
822822static void
823823dir_list_file_internal (parray * files , pgFile * parent , bool exclude ,
824- bool follow_symlink ,
824+ bool follow_symlink , bool skip_hidden ,
825825 int external_dir_num , fio_location location )
826826{
827827 DIR * dir ;
@@ -868,7 +868,7 @@ dir_list_file_internal(parray *files, pgFile *parent, bool exclude,
868868 }
869869
870870 /* skip hidden files and directories */
871- if (file -> name [0 ] == '.' )
871+ if (skip_hidden && file -> name [0 ] == '.' )
872872 {
873873 elog (WARNING , "Skip hidden file: '%s'" , file -> path );
874874 pgFileFree (file );
@@ -911,7 +911,7 @@ dir_list_file_internal(parray *files, pgFile *parent, bool exclude,
911911 */
912912 if (S_ISDIR (file -> mode ))
913913 dir_list_file_internal (files , file , exclude , follow_symlink ,
914- external_dir_num , location );
914+ skip_hidden , external_dir_num , location );
915915 }
916916
917917 if (errno && errno != ENOENT )
0 commit comments