1

I have a list of file path within a sub-directory. How can I find the created date for each of the file paths? I used the code below to get all the files within each sub-directory using Python:

def find(pattern, path): result = [] for root, dirs, files in os.walk(path): for name in files: if fnmatch.fnmatch(name, pattern): result.append(os.path.join(root, name)) return result find(pattern, Path) 
0

1 Answer 1

1

Try one of these functions:

os.path.getmtime(file_path) or os.path.getctime(file_path)

Sign up to request clarification or add additional context in comments.

3 Comments

More discussion on details here: stackoverflow.com/questions/237079/…
@OnlyDryClean Codzy: I've put the filenames into a dataframe would I just refer to column name with the file_path?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.