@@ -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 );
@@ -545,7 +546,8 @@ db_map_entry_free(void *entry)
545546 */
546547void
547548dir_list_file (parray * files , const char * root , bool exclude , bool follow_symlink ,
548- bool add_root , bool backup_logs , int external_dir_num , fio_location location )
549+ bool add_root , bool backup_logs , bool skip_hidden , int external_dir_num ,
550+ fio_location location )
549551{
550552 pgFile * file ;
551553
@@ -583,7 +585,7 @@ dir_list_file(parray *files, const char *root, bool exclude, bool follow_symlink
583585 parray_append (files , file );
584586
585587 dir_list_file_internal (files , file , root , exclude , follow_symlink ,
586- external_dir_num , location );
588+ skip_hidden , external_dir_num , location );
587589
588590 if (!add_root )
589591 pgFileFree (file );
@@ -805,7 +807,7 @@ dir_check_file(pgFile *file)
805807 */
806808static void
807809dir_list_file_internal (parray * files , pgFile * parent , const char * parent_dir ,
808- bool exclude , bool follow_symlink ,
810+ bool exclude , bool follow_symlink , bool skip_hidden ,
809811 int external_dir_num , fio_location location )
810812{
811813 DIR * dir ;
@@ -852,7 +854,7 @@ dir_list_file_internal(parray *files, pgFile *parent, const char *parent_dir,
852854 }
853855
854856 /* skip hidden files and directories */
855- if (file -> name [0 ] == '.' )
857+ if (skip_hidden && file -> name [0 ] == '.' )
856858 {
857859 elog (WARNING , "Skip hidden file: '%s'" , child );
858860 pgFileFree (file );
@@ -895,7 +897,7 @@ dir_list_file_internal(parray *files, pgFile *parent, const char *parent_dir,
895897 */
896898 if (S_ISDIR (file -> mode ))
897899 dir_list_file_internal (files , file , child , exclude , follow_symlink ,
898- external_dir_num , location );
900+ skip_hidden , external_dir_num , location );
899901 }
900902
901903 if (errno && errno != ENOENT )
0 commit comments