# this is the python script which is doing about a same thing except no formatting. And
# unfortunately I am not that good at python so I can not really figure out how
# to make similar output of "find" command. if somebody will figure out please
# post here
Code:
import os, time
ff = raw_input("type a name of the folder to scan: ")
# ff = '/user/folder/'
allfiles = []
subfiles = []
for root, dirs, files in os.walk(ff):
for f in files:
if f.endswith('.mp3') or f.endswith('.ogg'):
allfiles.append(os.path.join(root, f))
if root != ff:
subfiles.append(os.path.join(root, f))
#stats = os.stat(root)
#lastmod_date = time.localtime(stats[8])
#date_file_tuple = lastmod_date, files
#files.append(date_file_tuple)
#files.sort()
#files.reverse()
#print "%-60s %s" % ("filename:", "last modified:")
#for file in files:
# folder, file_name = os.path.split(file[1])
# file_date = time.strftime("%m/%d/%y %H:%M:%S", file[0])
# print "%-60s %s" % (file_name, file_date)
print "*"*80
print "allfiles=", allfiles
print "-"*112