Unix System Calls Question:

Explain c program to implement the Unix or Linux command to implement
ls -l >output.txt?

Tweet Share WhatsApp

Answer:

read the files in current directory using opendir and
readdir system calls. readdir will return filenames in the
directory. For each entry returned by readdir system call,
use stat system call to read statistics of the file. Stat
system call will give all the info about the file as that
of ls -l command.

Download Unix System Calls PDF Read All 7 Unix System Calls Questions
Previous QuestionNext Question
How to protect a process from others to kill?What is the difference between command and utility in Unix?