Last active
May 31, 2021 13:28
-
-
Save EscVector/a940acd8ccc05a7275698245eaad0913 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pathlib import Path | |
# Example load_files('c:/data/sqlfiles','sql') | |
def load_files(source_path,file_suffix): | |
filelist=[] | |
basepath = Path(source_path) | |
files = basepath.iterdir() | |
for file in files: | |
if file.suffix == "."+file_suffix: | |
fileinfo = str(file.name) + "," + str(file) + "," + str(file.stat().st_size) + str(file.stat().st_mtime) | |
filelist.append(fileinfo) | |
return(filelist) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment