CODE RIDER | Module : 3 Low- Level I/O | MODULE: 3 Test | ADVANCE PROGRAMING IN CISCO C CODE RIDER MODULE 3 TEST ANSWER - Learn with Ashiso

Come here to Learn Everything.

Breaking

Home Top Ad

Post Top Ad

Wednesday, June 16, 2021

CODE RIDER | Module : 3 Low- Level I/O | MODULE: 3 Test | ADVANCE PROGRAMING IN CISCO C CODE RIDER MODULE 3 TEST ANSWER





 Q. What should be placed instead of  <?>  to make the following snippet work properly?



Ans:- fd < 0

Q. Which snippet will you use to delete the file named file?

Ans:- unlink("file");

Q. The  1seek ( fd,  0,  SEEK_CUR ) invocation sets the file pointer to: 

Ans:- the same place as before invocation

Q. The  stat()  function:

Ans:-  is partially supported in non- Unix operating systems

Q. An  EBADF (Bad file descriptor) error may occur during ther invocation:

Ans:-  read ( fd, buff, 100) ;

Q. The dprintf() function is designed to:

Ans:-  use a file descriptor instead of the   FILE* pointer

Q. The so- called EPOCH time is the number of seconds elapsed from  00:00:00 UTC, 1 January:

Ans:- 1970

Q. A descriptor with a value equal to 0 ;

Ans:- is connected to   stdin

Q. How many bytes will the following program write to a file, assuming that the code is compiled by a CL compiler and successfully run on MS Windows?



Ans:- five 

Q. The  st_ino  field of the struct stat ;

Ans:- has no meaning in MS Windows

Q. An "endline translation" occurs:

Ans:- when the file is opened with an   O_TEXT flag

Q. The  readlink() function:

Ans:- gets the name of a file pointed to by the link

Q. To write all the elements of the array declared below.  You may use the invocation:



Ans :-  write ( fh,    vec,    sizeof ( vec ) ) ;

Q. To create a link in an MS Windows environment, you may use the function named:

Ans:- CreateSymbolLink()

Q. The O_CREATE  flag used by the open() function, has ther following effect:

Ans:- if the file does not exist, it will be created

Q. The low level open() function, when succeeded, returns :

Ans:- an int as a file descriptor 

Q. The fileno() function:

Ans:- extracts a file descriptor from the given FILE  structure

Q. The close() function:

Ans:- may not succeed

Q. The st_mode field of struct stat in an MS Windows environment determines the state of an " executable" attribute:

Ans:- using the file's name

Q. The  fcntl () function: 

Ans :- is not able to change ther access mode specified during the open() function invocation


No comments:

Post a Comment

Post Bottom Ad

Pages