Which of the following command is used to open a file “c:\temp.txt” for writing in binary format only?
2 points
outfile = open(“c:\temp.txt”, “w”)
B. outfile = open(“c:\\temp.txt”, “wb”)
C. outfile = open(“c:\temp.txt”, “w+”)
D. outfile = open(“c:\\temp.txt”, “wb+”)
Answers
Answered by
0
Answer:
B is the correct answer
Answered by
0
Concept:
Using different system calls, the operating system is responsible for completing the following file operations:
Read
Write
Create
Delete
Truncate files
Reposition
Find:
The command to write in binary format.
Solution:
outfile = open(“c:\temp.txt”, “w”)
* file – The file option defines whether the current working directory path is relative or absolute.
* mode – Use 'w' mode if you need to write to a text file.
Hence, option(a) is correct.
Similar questions