M
Merlin
Hello everyone,
I realize that I'm new to the group, but I'm hoping that someone might
be able to help me out. What I'm doing is using the GNU 7zip command
line utility to make a backup on my desktop. Essentially, I'm running
an executable that will create a folder, and drop a zipped up copy of
my data to that folder. There doesn't seem to be a way to get 7zip to
automatically create a file where the filename.zip would be a date/time
stamp (something like 020206143260.zip.
What I'd like to be able to do is allow 7.zip to create the file with
some arbitrary name, and then use the rename() function and the time.h
library to somehow grab the current date/time from the computer and
rename the file with the filename being the date/time stamp.
Would time.h be the right library to use? If so, does anyone have any
suggestions as to how a solution might be implemented? Any thoughts
would be greatly appreciated.
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
main()
{
chdir("C:\\Documents and Settings\\All Users\\Desktop\\");
mkdir("Backup");
chdir("C:\\Program Files\\Backup Utility\\");
system("7za.exe a -tzip \"C:\\Documents and Settings\\All
Users\\Desktop\\Backup\\Backup.zip\" \"C:\\Program
Files\\Data\\*.*\"");
chdir("C:\\");
}
Thanks for reading! I've been stumped on this one as I'm relatively
new to C (and programming in general.)
Once again, any help is greatly appreciated.
I realize that I'm new to the group, but I'm hoping that someone might
be able to help me out. What I'm doing is using the GNU 7zip command
line utility to make a backup on my desktop. Essentially, I'm running
an executable that will create a folder, and drop a zipped up copy of
my data to that folder. There doesn't seem to be a way to get 7zip to
automatically create a file where the filename.zip would be a date/time
stamp (something like 020206143260.zip.
What I'd like to be able to do is allow 7.zip to create the file with
some arbitrary name, and then use the rename() function and the time.h
library to somehow grab the current date/time from the computer and
rename the file with the filename being the date/time stamp.
Would time.h be the right library to use? If so, does anyone have any
suggestions as to how a solution might be implemented? Any thoughts
would be greatly appreciated.
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
main()
{
chdir("C:\\Documents and Settings\\All Users\\Desktop\\");
mkdir("Backup");
chdir("C:\\Program Files\\Backup Utility\\");
system("7za.exe a -tzip \"C:\\Documents and Settings\\All
Users\\Desktop\\Backup\\Backup.zip\" \"C:\\Program
Files\\Data\\*.*\"");
chdir("C:\\");
}
Thanks for reading! I've been stumped on this one as I'm relatively
new to C (and programming in general.)
Once again, any help is greatly appreciated.