Solved

How to take incremental backup of a file.

Posted on 2009-07-08
8
255 Views
Last Modified: 2013-12-14
Hello Sir,

How to take incremental backup of a file on Window's XP using VC++. Please tell me any method or source code which take full backup of a file when it will be created and for the rest of days it only take backup of changes made in file. Please help me out.

Thanks & Regards
0
Comment
Question by:davinder101
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 39

Expert Comment

by:itsmeandnobodyelse
ID: 24812484
Why do you want reinvent the wheel?

There is enough software - also for free - which does what you want.

Why not using them?
0
 

Author Comment

by:davinder101
ID: 24812912
I don't want to use other's software i want to make my own program which will take incremental backup of file, i downloaded so many software's but all of them are taking backup of full file every time even there is small changes in file. Please tell me any method or code in VC++ which i can use in my program.
0
 
LVL 39

Accepted Solution

by:
itsmeandnobodyelse earned 500 total points
ID: 24813389
You could use RCS for making deltas between files.

See http://www.gnu.org/software/rcs/

For copying files either use CopyFile from WINAPI or make your own copy via stat, ifstream::open, ifstream::read, ofstream::open, ofstream::write, ifstream::close, ofstream::close.

The stat would give the filesize, while the stream functions would read/write the total file in binary mode to output folder.

For writing or keeping timestamps use SetFileTime. There are (older) DOS functions as well for file times but I don't know whether they still were supported by Windows and NTFS.

To search in folders and subfolders use FindFirstFile and FindNextFile recursively.  
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 39

Expert Comment

by:itsmeandnobodyelse
ID: 24813452
>>>> I don't want to use other's software

Note, instead of backup software you might consider a versioning and configuration tool. SourceSafe is for free with Visual C++ pro but you also may use a free tool like cvs or reflection. Contrary to backup systems, versioning tools generally store deltas. They automatically create a full file version if the deltas were too many or need more space than the original file.
0
 

Author Comment

by:davinder101
ID: 24837532
How to use RCS on Window's XP using VC++ to make program for incremental backup.
0
 

Author Comment

by:davinder101
ID: 24837658
RCS is mainly develop for UNIX system and i want to make program for Window's system. So please tell me any method or code to take incremental backup on Window's.
0
 
LVL 39

Expert Comment

by:itsmeandnobodyelse
ID: 24941136
>>>> RCS is mainly develop for UNIX system and i want to make program for Window's system.

I have seen a few Windows implementations of versioning systems based on pure RCS. I will make some investigations for free RCS libraries for Windows.
0
 
LVL 39

Expert Comment

by:itsmeandnobodyelse
ID: 24941143
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question