๐Ÿ“Š Operating System Architecture
Q. Below is the codeint main() { int fd1, fd2;
struct stat buff1, buff2;
fd1 = open(“1.txt”, O_RDWR); fd2 = open(“2.txt”, O_RDWR | O_APPEND);
lseek(fd1, 10000, SEEK_SET);
write(fd1, “abcdefghij”, 10);
write(fd2, “abcdefghij”, 10); fstat(fd1, &buff1);
fstat(fd2, &buff2);
printf(“ %d %d”, buff1.st_size, buff2.st_size);
return 0;
}
Before running the program, the file 1.txt and 2.txt size is 20 each.
What is the output?
  • (A) 30 30
  • (B) 100020 20
  • (C) 100030 30
  • (D) 100010 30
๐Ÿ’ฌ Discuss
โœ… Correct Answer: (D) 100010 30

You must be Logged in to update hint/solution

๐Ÿ’ฌ Discussion

๐Ÿ“Š Question Analytics

๐Ÿ‘๏ธ
518
Total Visits
๐Ÿ“ฝ๏ธ
2 y ago
Published
๐ŸŽ–๏ธ
Mr. Dubey
Publisher
๐Ÿ“ˆ
98%
Success Rate