LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   want to execute edquota command inside a c program (https://www.linuxquestions.org/questions/linux-newbie-8/want-to-execute-edquota-command-inside-a-c-program-682525/)

admirelinux 11-10-2008 10:24 PM

want to execute edquota command inside a c program
 
hi all
me new to linux..
have learnt the usage of quota command
when i run the command from terminal i get to edit the quota through vi editor..
so i want to know how i can run edquota command from a c program.

Thanks in advance,
Admire linux :)

claudius753 11-10-2008 10:34 PM

What about:

Code:

system("whatever command you want");

admirelinux 11-10-2008 10:58 PM

thanks for your reply :)
i used edquota -u username.
here when i execute the command from terminal i get the vi editor by default
and when i save it it is converted to binary by the edquota command and stored in the quota.user file right ....
so i cannot not edit that binary file directly...
if i use system (command) then i cant edit the file that opens..
thats my problem ...
is there another way ??

estabroo 11-10-2008 11:11 PM

Just a guess but you'll probably have to use a pseudo-terminal, some manpages to look at, pty, forkpty, pts


All times are GMT -5. The time now is 06:43 PM.