![]() |
|
|
grep unix.com with google
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Our Members | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
Hi, I'm calling the split command from inside C and i'm wondering why it is not working (the file is not being split). Also, when I try executing only the unix command in the shell, it's working just fine. Am I missing something here? Below is my code:
Quote:
|
|
|||
|
Quote:
try: Code:
#include <stdio.h>
#include <stdlib.h>
int main(const int argc, const char* const* const argv) {
int res;
int err;
res = system("split -l 50 -a 1 /absolutepath/sample.txt");
fprintf(stdout,"execution returned %d.\n",res);
if ((-1 != res) && (127 != res))
fprintf(stdout,"now would be a good time to check out 'man split' to check what the resulting return-value (%d) means.\n",res);
return res;
}
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Tags |
| linux, linux commands |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| command << EOF(dont want to call other script) | user_prady | Shell Programming and Scripting | 4 | 11-15-2007 04:19 AM |
| how to differentiate system call from library call | muru | UNIX for Advanced & Expert Users | 2 | 07-20-2007 12:20 AM |
| How to call a Linux command in C prog. | krishna_sicsr | Shell Programming and Scripting | 1 | 04-08-2007 04:53 AM |
| how can call perl script as command? | umen | UNIX for Dummies Questions & Answers | 1 | 10-14-2005 10:43 PM |
| Making Socket System Call From Linux Kernel Module? | mian_m_hamayun | Linux | 0 | 04-06-2005 10:34 AM |