Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 20th, 2006, 4:23 PM   #1
NightShade01
Programmer
 
Join Date: Oct 2005
Posts: 52
Rep Power: 4 NightShade01 is on a distinguished road
Time modified

Hey i'm trying to write a backup program for a project for school. One of the things i have to do is create a constructor with three arguments: src (file being save) dest (location to save it to) and long time (milliseconds) that indicates when the last backup was. How would i go about using the time arguement within my code? I was thinking when the file is created give it a time in milliseconds and then overwrite it when the file is backuped again? Any suggestions???
NightShade01 is offline   Reply With Quote
Old May 20th, 2006, 6:43 PM   #2
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 769
Rep Power: 3 Jimbo is on a distinguished road
You might be able to do something with the File.lastModified() method. If you're backing up to the same file every time, you could compare that to the current file. If you back up to different places you might have to keep track of things accordingly.
Jimbo is offline   Reply With Quote
Old May 20th, 2006, 6:48 PM   #3
NightShade01
Programmer
 
Join Date: Oct 2005
Posts: 52
Rep Power: 4 NightShade01 is on a distinguished road
it's not the same file it's a directory of files that need to go from one directory to another. I found this:

getBackupFile

public java.io.File getBackupFile()

Get the name of the backup file for this resource.

through google but i'm not sure how to use it within my code.
NightShade01 is offline   Reply With Quote
Old May 20th, 2006, 7:07 PM   #4
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 769
Rep Power: 3 Jimbo is on a distinguished road
Sounds like something someone wrote for themselves. You could write your own, and keep some sort of record of what's backed up to where. And if you're dealing with directories, you could to use File.listFiles(), and then check files in each directory. It's a little hard for me to give advice as to how to do it, as I don't totally know how your program works...
Jimbo is offline   Reply With Quote
Old May 20th, 2006, 7:23 PM   #5
NightShade01
Programmer
 
Join Date: Oct 2005
Posts: 52
Rep Power: 4 NightShade01 is on a distinguished road
It's for a class final project:
Create a class named Archiver with a consturctor like so:
Archiver(src, dest, long time) //where src is the source file and dest is the destination file

i also need to have a method "getChangedFiles" which returns a list of files needed to be backed up (ones that have been modified since the last backup)

another method called "backup" which actually does the backup

then i need another class named "ArchiveDriver"
which maintains a txt file that reads multiple lines of text that look like:

C:\src C:\dest 1234567

which becomes the arugement of Archiver's constructor

lastly the user should be able to backup, restore, and compress the files backed up.


So as you can see this is quiet a complex and challenging project which i'm really stuck on... lol
NightShade01 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:08 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC