Thursday, January 3, 2013

Files – User view part -2


In this chapter will continue to look through the lens of the user and see some more characterics.
File Access.
Historically, when magnetic tapes were the devices used as persitent media, the way to access these devices was sequential. One could not skip to a particular section in the media to access information but has to always start from the beginning and read data in order until desired position. They could be rewound however.
With the introduction of magnetic disks, sequential files became obsolete and random access files dawned. In this method there were explicit indices or keys use to locate the records on the media.
We'd never have to deal with sequential files. We will only be using random access files mostly. There are two ways to specify the position to start reading in the file.
1. The read operation is performed and for every read the position is specified.
2. Using seek operation the position is set and the read operation is performed.
This piece of information bears no significance to a designer now. We all are going to design file systems with Random Access Files.
Next. Although all through the last post and the current we were seeing attributes of files, there are still many special attributes assigned to a file that provide different options to the user. The following is the list.
1. Protection mode: Dictates can access the file.
2. Password: Password if the file is password protected.
3. Creator: Id of the creator of the file.
4. Owner: Id of the current owner of the file.
5. Readonly or read/write
6. Hidden or not
7. System file or a normal file
8. ASCII or binary file
9. Random access or sequential
10. Temporary or permanent
11. Creation time
12. Time of last access
13. Time of last change
14. Current size
15. Maximum size:
Attributes 11 to 13 are useful in scenarios where a tool such as Make must know if there was a change in the source file after it's last build. Then the file will be considered for compilation

No comments:

Post a Comment