For example a c language compiler may actually insist

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: , the file must be closed using this operation. 5. Read. Is used to read data stored in a file. 6. Write. Is used to write new data in a file. 7. Seek. This operation is used with random access files to first position the read/write pointer to a specific place in the file, so that data can be read from, or written to, that position. 8. Get attributes. Is used to access the attributes of a file. 9. Set attributes. Is used to change the user-settable attributes (such as, protection mode) of a file. 10. Rename. Is used to change the name of an existing file. 11. Copy. Is used to create a copy of a file, or to copy a file to an I/O device such as a printer or a display. File Naming When a file is created, it is given a name, which can be later used to access the file. The rules for naming files vary from one operating system to another. For instance, consider the following examples: 1. MS-DOS allows only up to 8 characters for a file name, Macintosh allows up to 31 characters, and Microsoft Windows allows up to 255 characters. With longer file names, users have greater flexibility in assigning more descriptive and meaningful names to their files. 2. Some operating systems allow only letters and numbers to be used in file names, whereas others also allow special characters (sometimes barring a few) to be used in file names. Hence names like letter3 Jrom Ram, reminder2_to_Sham are often valid file names. 3. Some operating systems (such as Unix) distinguish between upper case letters and lower case letters, whereas others (such as MS-DOS) do not. Thus the file names Sinha, sinha and SINHA will be treated as different and can be assigned to three different files in Unix, but they will be treated as same in MS-DOS and cannot be assigned to three different files. 4. Many operating systems support file names having two or more parts, with the different parts separated by a period. For example, MS-DOS supports two-part file names in which the first part can have 1 to 8 characters, and the optional second part can have 1 to 3 characters (such as letter.txt). In Unix, a file may have more than two parts, as...
View Full Document

This document was uploaded on 04/07/2014.

Ask a homework question - tutors are online