Linux OS Management Question:
Download Questions PDF

Code snippets

str1="45678n"
str2="123n"
f1 = fopen(file1,RDWR,RWX)
f2 = fopen(file1,RDWR,RWX)
write(f1,str1,len_str1)
write(f2,str2,len_str2)

o/p:

a) 12378
b) 123(newline)8(newline)
c) 123(newline)78(newline)
d) 45678(newline)123(newline)

Linux Operating System Management Interview Question
Linux Operating System Management Interview Question

Answer:

b) 123(newline)8(newline)

Download Linux Operating System Management Interview Questions And Answers PDF

Previous QuestionNext Question
What is stored in logfile as per below mentioned code if we execute ./a.out > logfile?

int main() {
int fd;
close(1);
fd = open("logfile",O_RDWR, 0744);
write(fd, "Hello", 5);
printf("Worldn");
return 0;
}

a) Hello
b) HelloWorld
c) World
d) None
Code snippet (file1 size is 2024)

f1 = fopen (file1, RDWR, RWX)
lseek(f1,1024,SEEK_SET)
write(f1,buf,10)
What is offset now.

a) 1024
b) 1034
c) 2034
d) 2054