Sponsored Content
Top Forums Programming Need help with running the tar command using system() call in C Post 302256503 by vsanjit on Monday 10th of November 2008 02:03:12 AM
Old 11-10-2008
Ahh..didn't know about this call at all.

Thanks so much man! Really appreciate it.
 

10 More Discussions You Might Find Interesting

1. Programming

nice command and nice() system call

Hi I want to implement the nice command in the shell that I am building. I came to know that there is a corresponding nice() system call for the same. But since I will be forking different processes to run different commands typed on the command prompt, is there any way I can make a command... (2 Replies)
Discussion started by: tejbuch
2 Replies

2. UNIX for Advanced & Expert Users

how to differentiate system call from library call

Hi, Ho do I differentiate system call from library call? for example if I am using chmod , how do I find out if it is a system call or library call? Thanks Muru (2 Replies)
Discussion started by: muru
2 Replies

3. Shell Programming and Scripting

tar command dont tar to original directory

HI, if I have a tarfile called pmapdata.tar that contains tar -tvf pmapdata.tar -rw-r--r-- 0/0 21 Oct 15 11:00 2009 /var/tmp/pmapdata/pmap4628.txt -rw-r--r-- 0/0 21 Oct 14 20:00 2009 /var/tmp/pmapdata/pmap23752.txt -rw-r--r-- 0/0 1625 Oct 13 20:00 2009... (1 Reply)
Discussion started by: borderblaster
1 Replies

4. Shell Programming and Scripting

how to call dot c file using system command

Hi every one, i have to dot pc files. One have main function but one dont have.I have to call dot pc file using system () cmd.File is being call have main function.Please let me know how i can call .pc file with two arguments from other dot pc file.I want some thing like sprintf(buf,... (1 Reply)
Discussion started by: goraya430
1 Replies

5. Programming

how to call dot c file using system command

Hi every one, i have to dot pc files. One have main function but one dont have.I have to call dot pc file using system () cmd.File is being call have main function.Please let me know how i can call .pc file with two arguments from other dot pc file.I want some thing like sprintf(buf, "ss_xxx.pc... (4 Replies)
Discussion started by: goraya430
4 Replies

6. Shell Programming and Scripting

Running a script in system() call and want the script's output

Hi All, I have a script(sample.sh) displaying the output of "dd" command. Now i am using this script in system() call as, system("sh sample.sh") in an application file. I want the output of system("sh sample.sh") in the application file itself. How can i get it? Many thnaks.... (9 Replies)
Discussion started by: amio
9 Replies

7. Shell Programming and Scripting

How to call the System command twice in the same perl script...

Hello experts, I have a perl script which looks for the ARGV and then loads the data as per it. Example. #Checking the server to connect if ($ARGV eq 'QA') { $ENV{"ORACLE_HOME"} = "/oracle/product/11.2.0"; $ENV{"PATH"} = "$ENV{'PATH'}:/oracle/product/11.2.0/bin"; ... (1 Reply)
Discussion started by: msrahman
1 Replies

8. Programming

need help with system call

hi everyone i wrote a system call and compiled the kernel succesfully... my system call is in a file in the kernel folder named my_syscall1.c (kernel/my_syscall1.c) the header file for this system call i added it in the folder include like this include/my_syscall1/my_syscall1.h my problem is... (2 Replies)
Discussion started by: demis87
2 Replies

9. Shell Programming and Scripting

Not correct processing of “\ “ in names of dirs inside shell script (tar command - system backup scr

Hello, Recently, I've started with shell scripting, and decided to write a script for my system backup using tar. When I was dealing with tar execution inside shell script I found this, inside shell we have the following code: tar $TAR_PARAMS $ARCHIVE_FILE $EXCLUDE $BACKUP_STARTwith... (6 Replies)
Discussion started by: ilnar
6 Replies

10. Shell Programming and Scripting

tar command to explore multiple layers of tar and tar.gz files

Hi all, I have a tar file and inside that tar file is a folder with additional tar.gz files. What I want to do is look inside the first tar file and then find the second tar file I'm looking for, look inside that tar.gz file to find a certain directory. I'm encountering issues by trying to... (1 Reply)
Discussion started by: bashnewbee
1 Replies
explain_open(3) 					     Library Functions Manual						   explain_open(3)

NAME
explain_open - explain open(2) errors SYNOPSIS
#include <libexplain/open.h> const char *explain_open(const char *pathname, int flags, int mode); const char *explain_errno_open(int errnum, const char *pathname, int flags, int mode); void explain_message_open(char *message, int message_size, const char *pathname, int flags, int mode); void explain_message_errno_open(char *message, int message_size, int errnum, const char *pathname, int flags, int mode); DESCRIPTION
These functions may be used to obtains explanations for open(2) errors. explain_open(const char *pathname, int flags, int mode); const char *explain_open(const char *pathname, int flags, int mode); The explain_open function is used to obtain an explanation of an error returned by the open(2) system call. The least the message will contain is the value of strerror(errno), but usually it will do much better, and indicate the underlying cause in more detail. The errno global variable will be used to obtain the error value to be decoded. This function is intended to be used in a fashion similar to the following example: int fd = open(pathname, flags, mode); if (fd < 0) { fprintf(stderr, '%s0, explain_open(pathname, flags, mode)); exit(EXIT_FAILURE); } pathname The original pathname, exactly as passed to the open(2) system call. flags The original flags, exactly as passed to the open(2) system call. mode The original mode, exactly as passed to the open(2) system call (or zero if the original call didn't need a mode argument). Returns: The message explaining the error. This message buffer is shared by all libexplain functions which do not supply a buffer in their argument list. This will be overwritten by the next call to any libexplain function which shares this buffer, including other threads. Note: This function is not thread safe, because it shares a return buffer across all threads, and many other functions in this library. explain_errno_open const char *explain_errno_open(int errnum, const char *pathname, int flags, int mode); The explain_errno_open function is used to obtain an explanation of an error returned by the open(2) system call. The least the message will contain is the value of strerror(errnum), but usually it will do much better, and indicate the underlying cause in more detail. This function is intended to be used in a fashion similar to the following example: int fd = open(pathname, flags, mode); if (fd < 0) { int err = errno; fprintf(stderr, '%s0, explain_errno_open(err, pathname, flags, mode)); exit(EXIT_FAILURE); } errnum The error value to be decoded, usually obtained from the errno global variable just before this function is called. This is neces- sary if you need to call any code between the system call to be explained and this function, because many libc functions will alter the value of errno. pathname The original pathname, exactly as passed to the open(2) system call. flags The original flags, exactly as passed to the open(2) system call. mode The original mode, exactly as passed to the open(2) system call (or zero if the original call didn't need a mode argument). Returns: The message explaining the error. This message buffer is shared by all libexplain functions which do not supply a buffer in their argument list. This will be overwritten by the next call to any libexplain function which shares this buffer, including other threads. Note: This function is not thread safe, because it shares a return buffer across all threads, and many other functions in this library. explain_message_open void explain_message_open(char *message, int message_size, const char *pathname, int flags, int mode); The explain_message_open function is used to obtain an explanation of an error returned by the open(2) system call. The least the message will contain is the value of strerror(errno), but usually it will do much better, and indicate the underlying cause in more detail. The errno global variable will be used to obtain the error value to be decoded. This function is intended to be used in a fashion similar to the following example: int fd = open(pathname, flags, mode); if (fd < 0) { char message[3000]; explain_message_open(message, sizeof(message), pathname, flags, mode); fprintf(stderr, '%s0, message); exit(EXIT_FAILURE); } message The location in which to store the returned message. Because a message return buffer has been supplied, this function is thread safe. message_size The size in bytes of the location in which to store the returned message. pathname The original pathname, exactly as passed to the open(2) system call. flags The original flags, exactly as passed to the open(2) system call. mode The original mode, exactly as passed to the open(2) system call (or zero if the original call didn't need a mode argument). explain_message_errno_open void explain_message_errno_open(char *message, int message_size, int errnum, const char *pathname, int flags, int mode); The explain_message_errno_open function is used to obtain an explanation of an error returned by the open(2) system call. The least the message will contain is the value of strerror(errnum), but usually it will do much better, and indicate the underlying cause in more detail. This function is intended to be used in a fashion similar to the following exameple: int fd = open(pathname, flags, mode); if (fd < 0) { int err = errno; char message[3000]; explain_message_errno_open(message, sizeof(message), err, pathname, flags, mode); fprintf(stderr, '%s0, message); exit(EXIT_FAILURE); } message The location in which to store the returned message. Because a message return buffer has been supplied, this function is thread safe. message_size The size in bytes of the location in which to store the returned message. errnum The error value to be decoded, usually obtained from the errno global variable just before this function is called. This is neces- sary if you need to call any code between the system call to be explained and this function, because many libc functions will alter the value of errno. pathname The original pathname, exactly as passed to the open(2) system call. flags The original flags, exactly as passed to the open(2) system call. mode The original mode, exactly as passed to the open(2) system call (or zero if the original call didn't need a mode argument). COPYRIGHT
libexplain version 0.52 Copyright (C) 2008 Peter Miller AUTHOR
Written by Peter Miller <pmiller@opensource.org.au> explain_open(3)
All times are GMT -4. The time now is 07:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy