I need to write a C program (not a C++ program) that allows some tasks to be preformed automatically from a menu-driven interface. Automate the following tasks:
1. Rename a file
2. Delete a file or a directory
3. Output Process Information
4. Execute “mode 644 ls -l”
5. Exit
I need to know what steps should I follow to achieve the result. is it possible to ask the user to enter all the names and commands in 1 line or I should ask him one by one.
thank you
open, creat, read, write, lseek and close
Are they all primitive?
:confused:
*Another Question: is there a different between a system call, and an i/o system call? (2 Replies)
Hi,
I'm new to UNIX system calls. Can someone share your knowledge as to how exactly system calls should be executed?
Can they be typed like commands such as mkdir on the terminal itself? Also, are there any websites which will show me an example of the output to expect when a system call like... (1 Reply)
Hello,
how would i be able to call ps in C programming?
thanks,
---------- Post updated at 01:39 AM ---------- Previous update was at 01:31 AM ----------
here's the complete system call, ps -o pid -p %d, getpit() (2 Replies)
Hi friends,
I have three questions.
1) What are system calls?
2) Is it necessary that system calls be in c language (in unix operating system)?
3) Importance of c language when programming in unix environment???
Looking forward to your wonderful replies!
... (2 Replies)
Hi friends,
I hope everyone is fine and doing well. I queried in my previous thread about the low-level qualities of C/C++ languages.I really thank you people for explaining, it was really helpful. One more ambiquity that I have in my mind is regarding the unix system calls like open, creat,... (1 Reply)
Discussion started by: gabam
1 Replies
LEARN ABOUT MOJAVE
new_printf_comp
XPRINTF_COMP(3) BSD Library Functions Manual XPRINTF_COMP(3)NAME
free_printf_comp, new_printf_comp -- extensible printf compilation
SYNOPSIS
#include <printf.h>
void
free_printf_comp(printf_comp_t pc);
printf_comp_t
new_printf_comp(printf_domain_t restrict domain, locale_t restrict loc, const char * restrict fmt);
DESCRIPTION
To ameliorate some of the slowness caused by the extra overhead in extensible printf (see xprintf(5)), a compile/execute mechanism has been
created. The new_printf_comp() function compiles the given format string, along with a printf domain (see xprintf_domain(3)) and an extended
locale (see xlocale(3)), and returns a printf_comp_t structure. The domain may not be NULL, but the locale can be NULL, which means to use
the current locale, either the per-thread locale if it was set, or else the global locale. Because the printf_comp_t structure records the
domain and locale, care should be taken if either of these are changed.
Once a printf_comp_t structure is created, it can be passed to one of the extensible printf execution variants, described in xprintf_exec(3),
along with the necessary arguments. Creating the printf_comp_t structure needs to be done only once, but it can be passed to extensible
printf execution variants any number of times.
When the printf_comp_t structure is no longer needed, it should be passed to free_printf_comp() to release internal memory.
RETURN VALUES
The new_printf_comp() function returns the new structure, or NULL on error (usually NULL domain or out of memory condition).
SEE ALSO xlocale(3), xprintf_domain(3), xprintf_exec(3), xprintf(5)Darwin Aug 19, 2012 Darwin