Question: ` stat ( ) ( ) ' report the kind of file being queried. How is this information used in ` stat _ demo.c '

`stat()()' report the "kind" of file being queried. How is this
information used in `stat_demo.c'?
-() The field `sb.st_filetype' is set to a string like "file" or
"pipe" to indicate the type of a file and that field can be printed
directly
-() An integer passed in as an address to the call is set to the
type of the file
-(X) The kind is encoded in the `sb.st_mode' field of the struct and
macros are used to distinguish the kind and print an appropriate
message.
-() The kind is encoded in the `sb.st_mode' field of the struct and
functions are used to distinguish the kind and print an appropriate
message.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!