Solved

How to take incremental backup of a file.

Posted on 2009-07-08
8
252 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
  • 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Anomalies in ASP.NET ConnectionStrings 4 89
eclipse ide not starting 16 85
selectallvieditor 6 119
installing and using WTP plugin eclipse MARS 3 124
In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

840 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