I have a file (it could be type of typing.IO or tempfile.SpooledTemproraryFile)
How I can get the date of the last modification, I don't know what is the path to the file, the only thing that I have is a file.
My code:
from tempfile import SpooledTemporaryFile
from typing import IO
def partition_csv( file: Union[IO, SpooledTemporaryFile] ):
# read last modification time of file
If file is of type
SpooledTemporaryFile:To get the directory where the temporary files in your system are stored, use
tempfile.gettempdir(): https://docs.python.org/3/library/tempfile.html#tempfile.gettempdir.To get the last modification time: https://docs.python.org/3/library/os.path.html#os.path.getmtime.