 Hello everyone, I, Mrs. Komal Pardeshi working as an assistant professor in department of computer science and engineering of Valchin Institute of Technology, Solapur going to deliver a lecture on internal representation of files in Unix operating system. The learning outcome of this session are at the end of this session student will be able to describe the internal structure of files in Unix operating system. These are different file system algorithms. As we already know, there are different buffer allocation algorithms gate block, buffer release, buffer read, buffer read ahead and buffer write. Gate block algorithm is used for allocation of buffer. Buffer release algorithm is used to release a buffer while buffer read algorithm is used to read the content of the disk block and the buffer read ahead algorithm is used to read subsequent content from the disk block to the buffer while the buffer write algorithm is used to write the content of the buffer to the disk block. These algorithms we already studied in the last chapter. Now in this chapter we are going to see the lower level file system algorithms that are name i, i get, i put, b map, a lock, free, i lock and i free. All these algorithms are related to the files. The name i algorithm is used to convert the path name into an i node using algorithm i gate, i put and b map. i gate, i put, b map algorithms are used to the allocate the i node to the file. i put algorithm is used to release the i node from the file and b map algorithm is used to read the content from that file. A lock and free algorithm are used to allocate and free the disk block for the file while i lock and i free algorithms are used to allocate an i node to the newly created file and free that i node. So all these algorithms are related to the file system. Now how file is created in Unix operating system? In Unix everything is created as a file. Even devices are also created as a special file. All devices are represented by files called as a special file that are located in slash dev directory. These are accessed in the same way as a regular file. Device files has two categories. First is block special file and second is character special file. In block special file data gets transferred in terms of blocks. So it has characteristics similar to the disk and that's why it is called as a block special file. While in character special file data get transferred by stream of bits in sequential order like keyboard. So it is called as a character special file. Every file on Unix operating system has an unique i node. Processes access files by well defined set of system calls. File can be specified by a character string called as a path name. Each path name is unique and it is converted into an i node. What is an i node? i node is nothing but an index node. It exists in a static form on a disk. The kernel reads them into an in core i node to manipulate them. Basically i node contains information necessary for a process to access file such as file ownership, access rights, file size and location of the files data. i node has two types. First type is disk i node which is nothing but copy on disk that is secondary storage. And the second type is in core i node which is copy in memory. So whenever file is access by process in core copy of an i node is generated in memory. First we are going to see what disk i node contains. Disk i node consists of file owner identifier, file owner are individual owner or group owner or other users. Whatever that file owner is that is defined in file owner identifier field. File type, the type of the file may be a regular file, device file. Device file means it may be a block special file or character special file. It may be a directory and the another type of file is FIFO that is first in first out which is also called as a pipe. So file types are regular file, device special files, directory or pipes. File access permissions, file is protected by owner, group owner or other users. So there are different access permissions for the file like read, write and execute. As I said directory is also created as a file. So the execute permission to the directory means that directory can be searchable. We can search data into that directory. The next field is file access time. It indicates that the file can be accessed at what time, at what time it is modified. The number of links to the file, number of links shows how many number of files are linked to this currently existing file. Table of content for the disk address of data in a file. Now user treats the file as a sequential logical stream of bytes but actually that file is stored on different disk blocks on the disk. So the discontinuous disk blocks addresses are stored in a table in an disk iNode. Then file size. The size of the file is also mentioned in an disk iNode. This is a sample disk iNode where the file is owned by owner MJB, group owner of the file is operating system. Type of the file is regular file. Permissions to the file are read, write and execute and these are the date and time for file access and modified. When iNode means at what time that iNode is changed. It shows the time when iNode of that file gets changed. Next the size of the file and the disk address means the table which contains the address of the discontinuous block of the disk which contains the data of that file. Now this iNode get changed whenever we change the owner or the group or the type of the file or if we change some contents into that file. Now just pause a video and write down your answer for the question when will be the content of the disk iNode get changed by the kernel. Now when the content of the disk iNode get changed. Content of the disk iNode get changed when the content of the file gets changed. Second iNode get changed whenever we change the file owner or file permission or link setting to the file. So it is important to note that changing the content of the files automatically implies a change to an iNode. But changing the iNode does not imply that the content of the file get changed. The next type of an iNode is in core iNode. It consists of status of in core iNode indicating whether the iNode is locked. Whether the process is waiting for an iNode to become unlocked. The in core representation of the iNode which differs from the disk copy as a result of change to the data in the iNode. The in core representation of the iNode differs from the disk copy as a result of change to the file data means if the content of the files get changed. Then the file is a mount point. In core iNode also consists of the logical device number of the file system that contains the file. It contains the iNode number since all the iNodes in Unix are stored in a linear array. So the iNode number of the disk iNode is identified by the position of that disk iNode into that linear array. Pointer to other in core iNode. One iNode may point to other in core iNode because all these in core iNodes are stored in on a hash queue or on a free list. So there is link between different in core iNodes. A reference count it shows that how many number of instances are linked to the currently executing file. So if we want to differentiate between an in core iNode and a disk iNode, disk iNode is nothing but the copy of an iNode onto the disk. While in core iNode is nothing but the copy of an iNode in memory. In core copy is nothing but the content of the disk iNode are copied into the memory in in core iNode. And along with the content of the disk iNode, in core iNode contains all these fields. So the content of the in core copy of an iNode may differ from the disk copy of an iNode if there is change in the file contents. So this is all about the iNode of the file in Unix operating system. iNode has two types that is disk iNode and in core iNode. So this is all about the iNode of the file in Unix operating system. In next video we are going to see about how this iNode can be accessed or released by the files in Unix operating system. These are the references. Thank you.