Solved

How to take incremental backup of a file.

Posted on 2009-07-08
8
243 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
 
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now