Re: Getting previous file name

2006-08-08 Thread John Machin
Miki wrote: > Hello hj, > > > I have a small script here that goes to inside dir and sorts the file > > by create date. I can return the create date but I don't know how to > > find the name of that file... > > I need file that is not latest but was created before the last file. > > Any hints... I

Re: Getting previous file name

2006-08-08 Thread Miki
Hello hj, > I have a small script here that goes to inside dir and sorts the file > by create date. I can return the create date but I don't know how to > find the name of that file... > I need file that is not latest but was created before the last file. > Any hints... I am newbiw python dude and

Re: Getting previous file name

2006-08-08 Thread Hitesh
Thank you all. Here is my BETA ver. import os, time, sys from stat import * def findfile(path): file_list = [] for f in os.listdir(path): filename = os.path.join(path, f) if not os.path.isfile(filename): print "*** Not a file:", repr(filename) cont

Re: Getting previous file name

2006-08-08 Thread Hitesh
John Machin wrote: > Hitesh wrote: > > Hi, > > > > I have a small script here that goes to inside dir and sorts the file > > by create date. I can return the create date but I don't know how to > > find the name of that file... > > I need file that is not latest but was created before the last fi

Re: Getting previous file name

2006-08-08 Thread Hitesh
Thank you everyone. It worked. Here is the BETA 0.9 :) import os, time, sys from stat import * def findfile(path): file_list = [] for f in os.listdir(path): filename = os.path.join(path, f) if not os.path.isfile(filename): print "*** Not a file:", repr(filenam

Re: Getting previous file name

2006-08-07 Thread John Machin
Hitesh wrote: > Hi, > > I have a small script here that goes to inside dir and sorts the file > by create date. I can return the create date but I don't know how to > find the name of that file... > I need file that is not latest but was created before the last file. > Any hints... I am newbiw pyth

Re: Getting previous file name

2006-08-07 Thread Tim Williams
On 7 Aug 2006 13:52:16 -0700, Hitesh <[EMAIL PROTECTED]> wrote: > > I have a small script here that goes to inside dir and sorts the file > by create date. I can return the create date but I don't know how to > find the name of that file... > I need file that is not latest but was created before th

Re: Getting previous file name

2006-08-07 Thread Larry Bates
Hitesh wrote: > Hi, > > I have a small script here that goes to inside dir and sorts the file > by create date. I can return the create date but I don't know how to > find the name of that file... > I need file that is not latest but was created before the last file. > Any hints... I am newbiw pyt

Getting previous file name

2006-08-07 Thread Hitesh
Hi, I have a small script here that goes to inside dir and sorts the file by create date. I can return the create date but I don't know how to find the name of that file... I need file that is not latest but was created before the last file. Any hints... I am newbiw python dude and still trying t