http://qs321.pair.com?node_id=955525


in reply to Re: incrementing the file
in thread incrementing the file

Or create a last.txt, containing the name of the latest file. Your open it at the start of your program, overwrite and close it at the end. Not very elegant, but simple and robust.