PDA

View Full Version : Adding Date and Time to a file after creating a backup


JoeDul
07-21-2005, 04:10 PM
hey,

I dont know why I am having problems doing this but, this is what I need to accomplish.

1. I need to take a file, back it up with a different extenison.
(e.g. Delta.mnu to read Delta.Bak) This Ive been doing all along with a File.Copy. Works just fine.

2. Now I need to add or concatenate the Date and Time to the Delta.Bak file.
I tried using the System.GetTime and System.GetDate. I cant seem to get it to work?

I want to increment the Date and Time each time the file is backed up. Not to overwrite the .Bak file

Is there a function that can be used to Backup a file and add the Date and Time and increment the backup file?

Let me know what I can try?

Thanks

Joe

bnkrazy
07-21-2005, 05:52 PM
Haven't tried it but you used to be able to rename the file as it was copied in SF6...this should do the equivalent in SF7:

File.Copy(strSource, strDestFolderOnly .. "\Filename" .. System.GetDate(DATE_FMT_ISO) .. System.GetTime(4) .."-".. System.GetTime(3) .."-".. System.GetTime(2) ..".ext");

JoeDul
07-22-2005, 02:56 PM
I made some changes and it worked exactly how I needed it.
Thanks for the help.

-Joe