Needing to find the latest filename in a specific directory. This is very basic but works
How to I retrieve that filename, so that I can then run 'gunzip' on the file and create the uncompressed file ? The gunzip part should be easy, it is retrieving that filename ?? Obviously STDOUT in some form. Also, I have read that using "ls" is not the best method ?
# Importing required module import subprocess # Using system() method to # execute shell commands subprocess.Popen('ls ~/Documents/Backups -Artls | tail -1', shell=True)
Quote:960 -rw-r--r-- 1 ******** ******** 981156 Nov 28 08:01 Australian-2024-11-28.kmy
How to I retrieve that filename, so that I can then run 'gunzip' on the file and create the uncompressed file ? The gunzip part should be easy, it is retrieving that filename ?? Obviously STDOUT in some form. Also, I have read that using "ls" is not the best method ?