@@ -124,8 +124,9 @@ typedef struct TablespaceCreatedList
124124static int pgCompareString (const void * str1 , const void * str2 );
125125
126126static char dir_check_file (pgFile * file );
127+
127128static void dir_list_file_internal (parray * files , pgFile * parent , const char * parent_dir ,
128- bool exclude , bool follow_symlink ,
129+ bool exclude , bool follow_symlink , bool skip_hidden ,
129130 int external_dir_num , fio_location location );
130131static void opt_path_map (ConfigOption * opt , const char * arg ,
131132 TablespaceList * list , const char * type );
@@ -513,7 +514,8 @@ db_map_entry_free(void *entry)
513514 */
514515void
515516dir_list_file (parray * files , const char * root , bool exclude , bool follow_symlink ,
516- bool add_root , bool backup_logs , int external_dir_num , fio_location location )
517+ bool add_root , bool backup_logs , bool skip_hidden , int external_dir_num ,
518+ fio_location location )
517519{
518520 pgFile * file ;
519521
@@ -551,7 +553,7 @@ dir_list_file(parray *files, const char *root, bool exclude, bool follow_symlink
551553 parray_append (files , file );
552554
553555 dir_list_file_internal (files , file , root , exclude , follow_symlink ,
554- external_dir_num , location );
556+ skip_hidden , external_dir_num , location );
555557
556558 if (!add_root )
557559 pgFileFree (file );
@@ -773,7 +775,7 @@ dir_check_file(pgFile *file)
773775 */
774776static void
775777dir_list_file_internal (parray * files , pgFile * parent , const char * parent_dir ,
776- bool exclude , bool follow_symlink ,
778+ bool exclude , bool follow_symlink , bool skip_hidden ,
777779 int external_dir_num , fio_location location )
778780{
779781 DIR * dir ;
@@ -820,7 +822,7 @@ dir_list_file_internal(parray *files, pgFile *parent, const char *parent_dir,
820822 }
821823
822824 /* skip hidden files and directories */
823- if (file -> name [0 ] == '.' )
825+ if (skip_hidden && file -> name [0 ] == '.' )
824826 {
825827 elog (WARNING , "Skip hidden file: '%s'" , child );
826828 pgFileFree (file );
@@ -863,7 +865,7 @@ dir_list_file_internal(parray *files, pgFile *parent, const char *parent_dir,
863865 */
864866 if (S_ISDIR (file -> mode ))
865867 dir_list_file_internal (files , file , child , exclude , follow_symlink ,
866- external_dir_num , location );
868+ skip_hidden , external_dir_num , location );
867869 }
868870
869871 if (errno && errno != ENOENT )
0 commit comments