09-16-2005
using system cp command in C program
Hi
i used the following code to copy a directory from a source location to dest.
argv[1] contains the source loc i/p by the user.
strcpy(source,argv[1]);
strcpy(dest,"/home/MainServer/Job_dir/");
system("cp -r $source $dest");
it complies properly but during execution of the program it gives the following warning:
try cp --help
can anyone help me out with this?
thanx!
9 More Discussions You Might Find Interesting
1. Programming
I'm looking for a programmer to write a Program for The Unix Environment.
The program is quite simple, but have to be well written.
For information please contact me via private message or via msn messenger (0 Replies)
Discussion started by: dracox86
0 Replies
2. AIX
system() in a c++ program halts in AIX 5.3, though the corresponding binary working fine in AIX 5.2 and lower version. I am executing a script using system in a c++ program. the script has the execute permission by all. (0 Replies)
Discussion started by: Amiya Rath
0 Replies
3. Windows & DOS: Issues & Discussions
I am sure this question has been asked and answered before, also, if it is the wrong catergory, please let me know.
I would like to know how, if possible to run Unix/Linux as my operating system, and then load XP as a program? (I am open to other operating systems, but it has to be able to... (3 Replies)
Discussion started by: mountainwolf
3 Replies
4. UNIX for Dummies Questions & Answers
Hi,
i want to write a script that executes a program (exec?) .
this program then requires a filename as input.
how do i give it this input in the script so the program will be complete run and close by the script.
e.g.
exec prog.exe
program then asks for filename
"enter filename:"... (1 Reply)
Discussion started by: tuathan
1 Replies
5. Programming
Dear all,
Currently I'm working on a C program (OS = ubuntu 9.0.4)in which a USB key will
be mounted and umounted for several times. I read the man page
of the mount system call.
I use the following test code
#include <sys/mount.h>
int main(int argc, char *argv)
{
if... (5 Replies)
Discussion started by: dariyoosh
5 Replies
6. Programming
Hello everyone!
I'm quite new here, but this forum helped me a lot before without registering :-)
I'll go directly to my problem, I have been searching a bit about this issue but I was not successful.
I need to write a program in C code to notificate me (to my email) when some action is done... (7 Replies)
Discussion started by: RoNNo
7 Replies
7. UNIX for Dummies Questions & Answers
this method is not working.I am having a problem to use variables in system command. i cannot use the variables in system command.
this how i was did
system("whereis command");
this method works very fine. but, i want use the commands as variable.
that means i want only pass the variables.... (6 Replies)
Discussion started by: dhanda2601
6 Replies
8. UNIX for Advanced & Expert Users
Hi,
I was working in an IT firm. My stream was UNIX, C, C++.
worked for an year and half and then left the job.
there has been a gap of 2 years already and wanna get back again. i have some 6 more months to that. want to do some certification to help me get back.
c,c++ are fine. unix system... (1 Reply)
Discussion started by: niaR
1 Replies
9. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
"Your a7.c program should use printf to print a nice message. (You can decide what to say.) Then the process... (9 Replies)
Discussion started by: miniviking10
9 Replies