running actual unix commands

Andrew Thomson ajthomson at optushome.com.au
Wed May 28 01:51:21 EDT 2003


just trying more approaches now...

files = os.listdir(dir)
print files

for file in files:
   fullfile = os.path.join(dir,file)
   print fullfile
   print os.path.getatime(fullfile)

On Wed, May 28, 2003 at 03:37:06PM +1000, Andrew Thomson wrote:
> not sure if this is the best way, but i'm attempting the following:
> 
> cmd = "find " + dir + " " + "-type f -name \"*.ajt\" -amin +" + time + "
> " + "| wc -l | awk \'{print $1}\'"
> files = os.system(cmd)
> print files
> 
> however as some might predict, the output of this program isn't what I
> expect..
> 
> ./test2.py
> 3
> 0
> 
> thoughts appreciated.
> 
> ajt.
> 
> 
> 
> 
> 
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 






More information about the Python-list mailing list