Solved

How to take incremental backup of a file.

Posted on 2009-07-08
8
254 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
Industry Leaders: 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

Independent Software Vendors: 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!

Question has a verified solution.

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

Suggested Solutions

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. …
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: …
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…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

730 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