get_file_list¶
- swpy.lib.utilities.get_file_list(path, recursive=False)¶
- Bring the files in - pathto the list. Generally, only files in depth 1 from- pathare fetched. If- recursiveis True, all files in subdirectories are included in the list. The files imported into the list contain extension and directory structure information. If it fails to get the file list, it returns None. If- pathis file, only that file is imported into the list. Since it was created based on- os.scandirfunction, the hidden file is also included in the list. If you do not have permission to execute- os.statfunction, you can return None even if the actual path exists.- Parameters
- Returns
- list– File name list / None (Success / Fail)
 - Examples - >>> get_file_list("dir1/", False) ["file1.txt", "file2.txt"] >>> get_file_list("dir1/", True) [“file1.txt”, “file2.txt”, “dir2/fileA.txt”, “dir2/dir3/file_a.txt”] >>> get_file_list("dir1/file1.txt", False) [“file1.txt”]