Using rsync programmatically in c++ - c++

I am using rsync command-line tool to transfer files from a source folder to a destination folder as follows:
rsync -r /source_folder /destination_folder
How can this be done programmatically in c++? I have looked into librync, which is supposed to do this. But i think it is not very well documented and dosent have examples to show how to sync two folders. Also I am looking for a way to do this preferably without using system()/popen().
Is there any other way to do this in c++?
Thanks in advance!

Related

How to create SAS Enterprise Guide Project without using SAS EG?

I want to create a SAS Enterprise Guide project without using SAS EG. Thank you in advance for you answers.
Tried creating a zip file with SAS programs and renaming the .zip extension to .egp, but it does not work.
I'm almost certain that there's some legal issue with reverse engineering it.
That being said - .egp does seem to be an archive.
For the most part,
it contains folders of generated names for each program in the .egp, as well as a folder with a generated name for the built in git repository.
and probably most importantly a .xml file describing the project, It also contains any embedded code.
I don't have time to go through it, but if you have Enterprise Guide licensed and just don't have access to it, perhaps ask a colleague to send an example project.
If instead of creating a *.zip file, you create a *.txt file.
Changing it's extension to *.sas will create a SAS program.

How to mark a folder using Linux so that it appears as hidden in Windows

There seems to be very little information out there on how to do this or even if it's possible..
Does anyone know?
Ps. I'm using GPFS and running mkdir on a folder then viewing it using Windows share. I know I can mark the folder as hidden Windows, but I want to know how to do it via Linux (if it's possible).
Thanks
Here's the answer!
Modify the /etc/samba/smb.conf file like so (for the relevant share):
hide files = /<folder_that_you_want_hidden>/
Then restart the Samba service:
/etc/init.d/smb restart
Your folder will now be hidden in Windows.

Run pkg within dmg C++

Tried searching on Google but can't seem to find any information.
I need to execute a pkg file which exists within a dmg file via code. Reason is software update. I download an update via my application (which is a dmg) and need to run it. On Windows this is pretty straightforward: run the exe. Having trouble figuring out how to achieve this on a Mac.
As far as frameworks go, I'm using wxWidgets with cocoa (if that helps).
I don't know of a way to do this directly with cocoa APIs, but you can use external commands to do it: use /usr/bin/hdiutil attach /path/to/image.dmg to mount the disk image, then something like /usr/sbin/installer -package /Volumes/mountedvolume/installer.pkg -target / to install the package (see man installer for more information and options). Note that if the package requires admin rights to install, you'll need to run the installer command as root.
EDIT: to get the full path of the mounted volume, you'll probably have to parse the output of hdiutil. It'll look something like this, although it'll depend significantly on the format of the disk image:
/dev/disk2 Apple_partition_scheme
/dev/disk2s1 Apple_partition_map
/dev/disk2s2 Apple_HFS /Volumes/mountedvolume

Is there any way to package Famous the way their demos do it?

I'm trying to integrate the Famous libraries into an existing web application and the usage of requireJS with separate Famous JS files is giving me headaches. The existing web application does not use requireJS and it would be a big project to retrofit it to do so.
However, when I look at this demo:
http://demo.famo.us/tentacles/
A "famous.lib.js" file is included which encapsulates all the requireJS functionality into a single file.
How is this file generated? Does the Famous toolchain allow for creating this? If so, what is the command used?
The generator-famous docs say: "A single command to prepare your project for production". That may be what I'm looking for, but I'm not sure of the syntax for that command.
Does anyone know?
Yes. The single command is simply 'grunt'
Run 'grunt' in your application's directory and it will create a distribution folder called 'dist'
Inside 'dist' you will find everything compact and ready to go.

How to copy Windows/System32 using C++

I have to build a copy tool project. I want to copy/clone the entire C: drive. I tried using SHFileOperation() and IFileOperation, but they allow me to copy files that are not system files only.
Can anyone suggest any API or method to complete the task?