The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 's manas6 UNIX for Dummies Questions & Answers 0 06-05-2008 07:44 AM
Return Key chapmana Shell Programming and Scripting 2 11-29-2006 04:52 AM
FTP return value Shaz UNIX for Advanced & Expert Users 7 06-11-2003 05:09 PM
the return value $? gusla Shell Programming and Scripting 3 12-08-2002 08:30 PM
Return value raphael.schwend Shell Programming and Scripting 1 05-03-2002 03:43 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 08-21-2007
latitude latitude is offline
Registered User
  
 

Join Date: Aug 2007
Posts: 4
cp and rm return non zero value

rm and cp return non zero values sometimes.

sprintf(tmp, "rm -rf %s/* 2>/dev/null\n", dest);
rc = system( tmp );
rc = 1 and errno =0

sprintf(tmp, "cp -r %s/* %s 2>/dev/null", source, dest);
rc = system( tmp );
rc = -1 and errno = 2.

The files exist and the paths are correct. I can do a manual copy but the application fails. If I restart the application, this works fine.
Can anyone tell why this could happen?
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:38 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0