File Management
Organization of data
       - Creating a file
       - Storing a file in required directory
       - Removing a file
       - Opening a file
       - Closing a file
       - Maintaining of file details
       - Name, Type, location, size ,
date and time of creation or modification
       - File Protection



                    http://raj-os.blogspot.in/   1
File Attributes

-   Name

-   Type

-   Location

-   Size

-   Protection

-   Time, Date and User Identification




                 http://raj-os.blogspot.in/   2
File Attributes

Name

  -    Given by the user

  -    Only information that is kept in human readable form

Type

         -   Information required by systems that support different
         types




                             http://raj-os.blogspot.in/               3
File attributes

Location

        - A pointer to a device and to the
        location of the file on that device

Size

       - Current size of file (in bytes or words )

        - Max size allowed

                         http://raj-os.blogspot.in/   4
File Attributes

Protection

      -   Access control information

          ( read, write and execute privileges )




                          http://raj-os.blogspot.in/   5
File Attributes

Time, date and user identification

      -       Creation

      -       Last modification

      -       Last use

  (Useful for protection, security and usage monitoring )




                         http://raj-os.blogspot.in/         6
Basic File Operations ( Minimal Set )

1. Creating a file

2. Repositioning within a file

3. Deleting a file

4. Truncating a file

5. Reading a file

6. Writing a file

                     http://raj-os.blogspot.in/   7
Basic File Operations


1. Creating a file


  •    Allocation of space for the file in the file system


  •    Making an entry for the new file in the directory




                          http://raj-os.blogspot.in/         8
Basic File Operations

2. Writing a file
•    Use a system call specifying
              - Name of the file

              - Information to be written

•    Search directory for the associated entry

•    Keep a write pointer

•    Update write pointer after every write

                        http://raj-os.blogspot.in/   9
Basic File Operations
3. Reading a file
•   Use a system call specifying
              - Name of the file
              - Address where to put the contents read
•   Search directory for the associated entry
•   Keep a read pointer

•   Update read pointer after every read



                          http://raj-os.blogspot.in/     10
Basic File Operations


4. Repositioning within a file

•   Also known as file seek operation

•   Search directory for the appropriate entry

•   Set current-file-position to a given value




                          http://raj-os.blogspot.in/   11
Basic File Operations


5.Deleting a file

•   Search the directory for the named file

•   Release all file space


•   Erase the directory entry




                             http://raj-os.blogspot.in/   12
Basic File Operations

6. Truncating a file

• File contents erased

• Name and attributes of file unchanged




                         http://raj-os.blogspot.in/   13
Other File Operations
• Appending
• Renaming
Appending
Add some information at the end of the file
Renaming
       Name of file changed

            All other attributes unchanged

               http://raj-os.blogspot.in/     14
Basic file operations can be combined to implement other
operations

Ex : Creating a copy of a file

- Create a new file

- Read from old file

- Write to new file




                           http://raj-os.blogspot.in/      15
Other Desirable Operations

Allow the user to get and set the various attributes of a file

Ex : i) get the file length

    ii) set file attributes like file’s owner




                         http://raj-os.blogspot.in/         16
Other Desirable Operations


Most file operations involve searching the directory for the

entry associated with the named file




                       http://raj-os.blogspot.in/         17
To Avoid Constant Searching

•   Many systems open a file when file first is used

•   The operating system keeps a small table called the

    Open file table

•   Open file table contains information about open files

•   When a file operation is requested, an index into the

    open file table is used


                              http://raj-os.blogspot.in/    18
Other File Operations

     When a file is no longer actively used, it is closed by
     the process and the O.S. removes its entry in the         Open
file table




                         http://raj-os.blogspot.in/               19
Other File Operations

• Some systems implicitly open a file when it is first referenced

• Close it automatically when the program that opened the file
  terminates




                          http://raj-os.blogspot.in/                20
Other File Operations


Most systems require that a file be opened explicitly by the

programmer with a system call ( open ) before that file can be

used




                       http://raj-os.blogspot.in/              21
File Type             Usual extension                           Function

Executable      Exe, com, bin or none                   Ready to run machine
                                                        language program
Object          obj, o                                  Compiled, machine language,
                                                        not linked

Source code     c, p, pas, f77, asm, a                  Source code in various
                                                        languages
Batch           bat, sh                                 Commands to the command
                                                        interpreter

Text            txt, doc                                textual data,documents
Word            Wp, tex, rrf etc                        Various word processor
Processor                                               formats
Library         Lib, a                                  Libraries of routines
Print or view   ps, dvi, gif                            ASCII or binary file in a
                                                        format for printing or viewing

Archive         arc, zip, tar                           Related group of files for
                                                        archiving or storage

                           Fig : Common File Types

                           http://raj-os.blogspot.in/                                    22
File Type

One major consideration in designing a file system, and the
entire operating system, is whether the operating system

should recognize and support file types




                       http://raj-os.blogspot.in/             23
File Type


•       If the operating system recognizes the type of a file
    •     it can then operate on the file in reasonable ways

    •     Ex : An attempt to print a binary-object form of a

          program file can be prevented




                            http://raj-os.blogspot.in/         24
File Type

To implement file types, include the type as part of
the file name
For Ex : letters , documents




                   http://raj-os.blogspot.in/      25
File Type


The file name is split into two parts

      -      a name

      -      an extension




                       http://raj-os.blogspot.in/   26
File Type

•   The file name is usually separated from the
    extension by a period ( dot ) character

    Ex : paycalc. cpp

•   The name can consists up to 8 characters followed
    by a period



                        http://raj-os.blogspot.in/      27
File Type
The extension tells what the file type is
• Extension can be up to 3 characters
• System uses the extension to indicate the type of the
  file
• Type of operations that can be done on that file
 For ex : .com , .exe & .bat extension are executable
  file

                       http://raj-os.blogspot.in/       28
Summary
In this class, you have learnt
- file concept
- Understand file operations
- Know various file types




                       http://raj-os.blogspot.in/   29

More Related Content

PPTX
File directory definition 54(2)
PPT
PDF
10 File System
PDF
File management
PDF
File system discovery
PPTX
Commands and shell programming (3)
PPT
Unix files
PPTX
2nd unit part 1
File directory definition 54(2)
10 File System
File management
File system discovery
Commands and shell programming (3)
Unix files
2nd unit part 1

What's hot (20)

PDF
The unix file system
PDF
Operating System Practice : Meeting 4 - operasi file dan struktur direktori-s...
DOCX
The linux file system structure
PPTX
Chapter 04
PDF
Unix files
PPTX
File system structure in linux
PDF
AdvFS/Advanced File System Ccncepts
PPSX
Management file and directory in linux
PPT
File protection.59 to 60
PPT
File Management
PPT
PPT
Ch11 file system interface
ODP
Nguyễn Vũ Hưng: Basic Linux Power Tools
PPTX
Chapter 3
PPTX
File Management
PPT
File system
PPTX
File Management
PPT
Xfs file system for linux
PPT
Unix File System
PPTX
Linux files
The unix file system
Operating System Practice : Meeting 4 - operasi file dan struktur direktori-s...
The linux file system structure
Chapter 04
Unix files
File system structure in linux
AdvFS/Advanced File System Ccncepts
Management file and directory in linux
File protection.59 to 60
File Management
Ch11 file system interface
Nguyễn Vũ Hưng: Basic Linux Power Tools
Chapter 3
File Management
File system
File Management
Xfs file system for linux
Unix File System
Linux files
Ad

Viewers also liked (20)

PPT
38 paged segmentation
PPT
35. multiplepartitionallocation
PPT
36 fragmentaio nnd pageconcepts
PPT
40 demand paging
PPT
Thrashing allocation frames.43
PPT
39 virtual memory
PPT
37 segmentation
PPT
Types of memory
PPT
Types of memory 10 to11
PPTX
Hibernate example1
PPT
Data type
PPT
Fundamentals
PPT
Deleting structure.56
PPT
Set model and page fault.44
PPT
Files concepts.53
PPT
4 various operating systems
PPTX
Operations on a directory 54(3
PPT
Disk scheduling.49
PPT
PPT
Issues in acyclic graph directories.57 to 58
38 paged segmentation
35. multiplepartitionallocation
36 fragmentaio nnd pageconcepts
40 demand paging
Thrashing allocation frames.43
39 virtual memory
37 segmentation
Types of memory
Types of memory 10 to11
Hibernate example1
Data type
Fundamentals
Deleting structure.56
Set model and page fault.44
Files concepts.53
4 various operating systems
Operations on a directory 54(3
Disk scheduling.49
Issues in acyclic graph directories.57 to 58
Ad

Similar to File management53(1) (20)

PPTX
Unit 6 OSY.pptx aaaaaaaaaaaaaaaaaaaaaaaa
PPTX
File system interface
PPTX
Linux 4 you
PPTX
file_concept.pptx file presentation directories
PPTX
Learn about the File Concept in operating systems ppt
PPTX
file_concept.pptx file presentation directories
PPT
operating system File - System Interface
PPTX
File concept and access method
PPT
file management_osnotes.ppt
PPT
managing-the-linux-file-system_suse_.ppt
PPT
managing-the-linux-file-system________________________
PPT
PDF
Javase7 1641812
PPTX
File Management & Access Control
PDF
Python file handling
PPT
Linux: Basics OF Linux
PDF
Ch10 file system interface
PPTX
5-filehandling-2004054567151830 (1).pptx
PPT
Basic linux architecture
Unit 6 OSY.pptx aaaaaaaaaaaaaaaaaaaaaaaa
File system interface
Linux 4 you
file_concept.pptx file presentation directories
Learn about the File Concept in operating systems ppt
file_concept.pptx file presentation directories
operating system File - System Interface
File concept and access method
file management_osnotes.ppt
managing-the-linux-file-system_suse_.ppt
managing-the-linux-file-system________________________
Javase7 1641812
File Management & Access Control
Python file handling
Linux: Basics OF Linux
Ch10 file system interface
5-filehandling-2004054567151830 (1).pptx
Basic linux architecture

More from myrajendra (20)

PPTX
Jdbc workflow
PPTX
2 jdbc drivers
PPTX
3 jdbc api
PPTX
4 jdbc step1
PPTX
Dao example
PPTX
Sessionex1
PPTX
Internal
PPTX
3. elements
PPTX
2. attributes
PPTX
1 introduction to html
PPTX
Headings
PPTX
Forms
PPT
PPTX
Views
PPTX
Views
PPTX
Views
PPT
Starting jdbc
PPTX
Properties
PPTX
Java.sql package
PPTX
Interface callable statement
Jdbc workflow
2 jdbc drivers
3 jdbc api
4 jdbc step1
Dao example
Sessionex1
Internal
3. elements
2. attributes
1 introduction to html
Headings
Forms
Views
Views
Views
Starting jdbc
Properties
Java.sql package
Interface callable statement

File management53(1)

  • 1. File Management Organization of data - Creating a file - Storing a file in required directory - Removing a file - Opening a file - Closing a file - Maintaining of file details - Name, Type, location, size , date and time of creation or modification - File Protection http://raj-os.blogspot.in/ 1
  • 2. File Attributes - Name - Type - Location - Size - Protection - Time, Date and User Identification http://raj-os.blogspot.in/ 2
  • 3. File Attributes Name - Given by the user - Only information that is kept in human readable form Type - Information required by systems that support different types http://raj-os.blogspot.in/ 3
  • 4. File attributes Location - A pointer to a device and to the location of the file on that device Size - Current size of file (in bytes or words ) - Max size allowed http://raj-os.blogspot.in/ 4
  • 5. File Attributes Protection - Access control information ( read, write and execute privileges ) http://raj-os.blogspot.in/ 5
  • 6. File Attributes Time, date and user identification - Creation - Last modification - Last use (Useful for protection, security and usage monitoring ) http://raj-os.blogspot.in/ 6
  • 7. Basic File Operations ( Minimal Set ) 1. Creating a file 2. Repositioning within a file 3. Deleting a file 4. Truncating a file 5. Reading a file 6. Writing a file http://raj-os.blogspot.in/ 7
  • 8. Basic File Operations 1. Creating a file • Allocation of space for the file in the file system • Making an entry for the new file in the directory http://raj-os.blogspot.in/ 8
  • 9. Basic File Operations 2. Writing a file • Use a system call specifying - Name of the file - Information to be written • Search directory for the associated entry • Keep a write pointer • Update write pointer after every write http://raj-os.blogspot.in/ 9
  • 10. Basic File Operations 3. Reading a file • Use a system call specifying - Name of the file - Address where to put the contents read • Search directory for the associated entry • Keep a read pointer • Update read pointer after every read http://raj-os.blogspot.in/ 10
  • 11. Basic File Operations 4. Repositioning within a file • Also known as file seek operation • Search directory for the appropriate entry • Set current-file-position to a given value http://raj-os.blogspot.in/ 11
  • 12. Basic File Operations 5.Deleting a file • Search the directory for the named file • Release all file space • Erase the directory entry http://raj-os.blogspot.in/ 12
  • 13. Basic File Operations 6. Truncating a file • File contents erased • Name and attributes of file unchanged http://raj-os.blogspot.in/ 13
  • 14. Other File Operations • Appending • Renaming Appending Add some information at the end of the file Renaming Name of file changed All other attributes unchanged http://raj-os.blogspot.in/ 14
  • 15. Basic file operations can be combined to implement other operations Ex : Creating a copy of a file - Create a new file - Read from old file - Write to new file http://raj-os.blogspot.in/ 15
  • 16. Other Desirable Operations Allow the user to get and set the various attributes of a file Ex : i) get the file length ii) set file attributes like file’s owner http://raj-os.blogspot.in/ 16
  • 17. Other Desirable Operations Most file operations involve searching the directory for the entry associated with the named file http://raj-os.blogspot.in/ 17
  • 18. To Avoid Constant Searching • Many systems open a file when file first is used • The operating system keeps a small table called the Open file table • Open file table contains information about open files • When a file operation is requested, an index into the open file table is used http://raj-os.blogspot.in/ 18
  • 19. Other File Operations When a file is no longer actively used, it is closed by the process and the O.S. removes its entry in the Open file table http://raj-os.blogspot.in/ 19
  • 20. Other File Operations • Some systems implicitly open a file when it is first referenced • Close it automatically when the program that opened the file terminates http://raj-os.blogspot.in/ 20
  • 21. Other File Operations Most systems require that a file be opened explicitly by the programmer with a system call ( open ) before that file can be used http://raj-os.blogspot.in/ 21
  • 22. File Type Usual extension Function Executable Exe, com, bin or none Ready to run machine language program Object obj, o Compiled, machine language, not linked Source code c, p, pas, f77, asm, a Source code in various languages Batch bat, sh Commands to the command interpreter Text txt, doc textual data,documents Word Wp, tex, rrf etc Various word processor Processor formats Library Lib, a Libraries of routines Print or view ps, dvi, gif ASCII or binary file in a format for printing or viewing Archive arc, zip, tar Related group of files for archiving or storage Fig : Common File Types http://raj-os.blogspot.in/ 22
  • 23. File Type One major consideration in designing a file system, and the entire operating system, is whether the operating system should recognize and support file types http://raj-os.blogspot.in/ 23
  • 24. File Type • If the operating system recognizes the type of a file • it can then operate on the file in reasonable ways • Ex : An attempt to print a binary-object form of a program file can be prevented http://raj-os.blogspot.in/ 24
  • 25. File Type To implement file types, include the type as part of the file name For Ex : letters , documents http://raj-os.blogspot.in/ 25
  • 26. File Type The file name is split into two parts - a name - an extension http://raj-os.blogspot.in/ 26
  • 27. File Type • The file name is usually separated from the extension by a period ( dot ) character Ex : paycalc. cpp • The name can consists up to 8 characters followed by a period http://raj-os.blogspot.in/ 27
  • 28. File Type The extension tells what the file type is • Extension can be up to 3 characters • System uses the extension to indicate the type of the file • Type of operations that can be done on that file For ex : .com , .exe & .bat extension are executable file http://raj-os.blogspot.in/ 28
  • 29. Summary In this class, you have learnt - file concept - Understand file operations - Know various file types http://raj-os.blogspot.in/ 29