Jeevan Mathew(deleted)
|
Re: Copying/Moving files from one dir to other
|
Jeevan Mathew(deleted)
09/01/2008 8:30 AM
post12657
|
Re: Copying/Moving files from one dir to other
> Is there any function in QNX to copy files from dir to dir or if any one > has implementation in C++ please share.
You mean rename() ?
http://www.qnx.com/developers/docs/6.3.2/neutrino/lib_ref/r/rename.html
Jeevan
|
|
|
Robert Rutherford(deleted)
|
Re: Copying/Moving files from one dir to other
|
Robert Rutherford(deleted)
09/02/2008 1:53 AM
post12664
|
Re: Copying/Moving files from one dir to other
> Is there any function in QNX to copy files from dir to dir or if any one has
> implementation in C++ please share.
There is no standard library function to copy files in QNX or POSIX. In BSD you have copyfile() but that is not present
in the QNX libs.
The incredibly lazy way is just something like
system("cp /path1/file1 /path2/file2")
but this depends on the 'cp' utility being present on your target and has very little ability
to detect or handle errors.
Otherwise you probably need to roll your own. It is not difficult code, but there are a few corner-cases you need to
take care of. In particular you need to think about the size, ownership and permissions of the file you are copying to,
especially if you are creating it. I suggest you at least glance over the source code for the command-line cp utility.
Hope that helps.
Rob Rutherford
|
|
|
Mario Charest
|
Re: Copying/Moving files from one dir to other
|
Mario Charest
09/02/2008 9:52 AM
post12678
|
Re: Copying/Moving files from one dir to other
> Is there any function in QNX to copy files from dir to dir or if any one has
> implementation in C++ please share.
I use Poco::File::copyTo. Poco is C++ library.
|
|
|