answersLogoWhite

0


Best Answer

All major operating systems allow developers to write code that can open a file in a variety of different ways, including "r" or "ro" (read-only) "rw" (read-write), "w" (write-only), and "a" (append, like "w" but starts at the end of the file, preserving the previous contents). In these operating systems, applications may choose to open a file as "read-only", which prevents accidental modification of the file by logic errors in the code.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Can you open a file in read only mode?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you open a read only file in Unix?

You can open any read-only file in Unix assuming that you have the read permission. Any utility or program that can get access to that file in read mode can open it, which would include programs such as 'more', 'less', 'vi', 'cat', etc. Read-only merely means you can't change it; but you could copy it or look at it.


Which mode is used to open a binary file in write and read mode?

open: O_BINARY|O_RDWR fopen: "rb+"


How you can delete the data in the file when you open the file in read or write mode in C programming?

When you open a file in write mode, eg. fp=fopen("filename.txt","w"); the content of the file is deleted.


How you can delete the data in the file by opening it in the C programming in read or write mode?

To delete all the existing data in a file, simply open it in write mode. If you open the file in append mode, you need to overwrite the existing data to delete part or all of that data.


What is an open filecompared to open read-only and open as copy file?

open mms photo recieved


Example for w plus mode in c?

1. open the file: fopen (name, "w+") 2. write into it 3. rewind 4. read from the file


How do you use fopen to read PHP files?

To read PHP files using fopen in PHP, you would first need to open the file using fopen with "r" mode. This opens the file for reading. Remember to check if the file opened successfully, and then you can use functions like fread to read the content of the file. Finally, close the file with fclose when done.


What is file mode and list various file mode operations available?

A file mode describes how a file is to be used, to read, to write to append etc. When you associate a stream with a file, either by initializing a file stream object with a file name or by using open() method, you can provide a second argument specifying the file mode. e.g. stream_object.open("filename",filemode); Following is the list of filemodes available in C++ ios::in ios::out ios::binary ios::ate ios::app ios::trunc ios::nocreate ios::noreplace


Why are pics locked and unuploadable on Windows 7?

They may be set to read only mode. Right click the file and look at the properties to see if the image is set to read only, or otherwise protected.


What is file mode in c plus plus?

There are 6 main types of file opening mode:* "r". Open file for reading and file must exist; * "w" Open file for writing. If file does not exist it is created or if life already exist it's content is erased. * "a" Open file for appending. It adds all information at the end of the file leaving old data untouched. If file does not exist it is created. * "r+" Open file for reading and writing and file must exist. * "w+" Open file for writing and reading. If file does not exist it is created or if life already exist it's content is erased. * "a+" Open file for appending and reading. Again all new data is written at the end of the file old data leaving untouched. If file does not exist it is created. (You can read old data by moving pointer in file using fseek or rewind functions from stdio.h. But all writing operations will be done at the end of the file no matter how you change pointer) It is assumed by default that file will be standard ASCII text file in order to open file as binary file, you need to add "b" indicator:FILE *myFile = fopen("myfile.txt", "wb");/ * following two has identical meaning */FILE *myFile = fopen("myfile.txt", "w+b");FILE *myFile = fopen("myfile.txt", "wb+");


How do you open include file in c?

1. You (human) want to read an include file: use a text editor. 2. Your program wants to read a file: use open/fopen.


What are typical access rights that may be granted or denied to a particular user for a particular file?

Read, write, execute, and functions in software objects.