SlideShare una empresa de Scribd logo
1 de 80
UNIT -3  UNIX FILE APIs ,[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],General file APIs
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Open ,[object Object],[object Object],#include <sys/types.h> #include <fcntl.h> int open (const char *pathname, int access  mode , mode_t permission);
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Umask ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],Creat  #include <sys/types.h> #include <unistd.h> Int creat (const char* pathname,mode_t mode)
Read ,[object Object],#include <sys/types.h> #include <unistd.h> ssize_t read (int fdesc ,void* buf, size_t size);
Write   ,[object Object],#include <sys/types.h> #include <unistd.h> ssize_t read (int fdesc ,void* buf, size_t size);
Close  ,[object Object],[object Object],[object Object],#include <unistd.h> int close (int fdesc);
fcntl ,[object Object],[object Object],#include <fcntl.h> Int fcntl (int fdesc ,int cmd);
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
lseek ,[object Object],[object Object],#include <sys/types.h> #include <unistd.h>  Off_t sleek (int fdesc , off_t pos, int whence)
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
link ,[object Object],[object Object],#include <unistd.h> int link (const char* cur_link ,const char*  new_link)
unlink ,[object Object],[object Object],#include <unistd.h> int unlink (const char* cur_link );
Stat fstat ,[object Object],#include <sys/types.h> #include <unistd.h>  int stat (const char* path_name,struct  stat* statv) int fstat (const int fdesc,struct stat* statv)
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],int lstat (const char* path_name , struct stat*  statv);
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Access   ,[object Object],#include <unistd.h> int access (const char* path_name, int flag);
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],Chmod fcmod #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> int chmod (const char* path_name, mode_t flag); int fchmod (int fdsec, mode_t flag);
[object Object],[object Object]
Chown fchown lchown ,[object Object],[object Object],#include <unistd.h> #include <sys/types.h> int chown (const char* path_name,  uid_t uid, gid_t gid);  int fchown (int fdesc, uid_t uid, gid_t gid);  int lchown (const char* path_name,  uid_t uid, gid_t gid);
utime ,[object Object],[object Object],#include <unistd.h> #include <sys/types.h> #include <utime.h> int utime (const char* path_name,  struct utimbuf* times);
[object Object],[object Object],[object Object],[object Object],[object Object]
FILE AND RECORD LOCKING ,[object Object],[object Object],[object Object],[object Object],[object Object]
Shared and exclusive locks ,[object Object],[object Object],[object Object]
[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object]
Advisory locks ,[object Object],[object Object],[object Object]
FCNTL file locking ,[object Object],Use Sets a file lock. Do not block if this  cannot succeed immediately. Sets a file lock and blocks the  calling process until the lock is  acquired. Queries as to which process locked  a specified region of a file. Cmd_flag F_SETLK F_SETLKW F_GETLK
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
l_type and l_whence fields of flock ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object]
[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Directory File APIs ,[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object]
Difference between mkdir and    mknod ,[object Object],[object Object],[object Object]
[object Object],[object Object]
FUNCTIONS ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Device file APIs ,[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object]
MAJOR AND MINOR NUMBERS ,[object Object],[object Object]
[object Object],[object Object],[object Object]
FIFO File APIs ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
How is synchronization provided? ,[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object]
[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Symbolic Link File APIs ,[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object]
QUESTIONS ,[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object]

Más contenido relacionado

La actualidad más candente

Alternate Data Streams
Alternate Data StreamsAlternate Data Streams
Alternate Data Streamsnephijohnson
 
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonSujith Kumar
 
standard template library(STL) in C++
standard template library(STL) in C++standard template library(STL) in C++
standard template library(STL) in C++•sreejith •sree
 
Python Dictionaries and Sets
Python Dictionaries and SetsPython Dictionaries and Sets
Python Dictionaries and SetsNicole Ryan
 
Files in c++ ppt
Files in c++ pptFiles in c++ ppt
Files in c++ pptKumar
 
Python unit 3 m.sc cs
Python unit 3 m.sc csPython unit 3 m.sc cs
Python unit 3 m.sc csKALAISELVI P
 
Class, object and inheritance in python
Class, object and inheritance in pythonClass, object and inheritance in python
Class, object and inheritance in pythonSantosh Verma
 
Lect 1-class and object
Lect 1-class and objectLect 1-class and object
Lect 1-class and objectFajar Baskoro
 
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYA
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYAPYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYA
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYAMaulik Borsaniya
 
Python Programming Essentials - M25 - os and sys modules
Python Programming Essentials - M25 - os and sys modulesPython Programming Essentials - M25 - os and sys modules
Python Programming Essentials - M25 - os and sys modulesP3 InfoTech Solutions Pvt. Ltd.
 
file handling c++
file handling c++file handling c++
file handling c++Guddu Spy
 
File concept and access method
File concept and access methodFile concept and access method
File concept and access methodrajshreemuthiah
 

La actualidad más candente (20)

Alternate Data Streams
Alternate Data StreamsAlternate Data Streams
Alternate Data Streams
 
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
 
standard template library(STL) in C++
standard template library(STL) in C++standard template library(STL) in C++
standard template library(STL) in C++
 
Data structure and its types.
Data structure and its types.Data structure and its types.
Data structure and its types.
 
Advanced Python : Decorators
Advanced Python : DecoratorsAdvanced Python : Decorators
Advanced Python : Decorators
 
Python Dictionaries and Sets
Python Dictionaries and SetsPython Dictionaries and Sets
Python Dictionaries and Sets
 
Files
FilesFiles
Files
 
Delegates and events in C#
Delegates and events in C#Delegates and events in C#
Delegates and events in C#
 
Files in c++ ppt
Files in c++ pptFiles in c++ ppt
Files in c++ ppt
 
Python unit 3 m.sc cs
Python unit 3 m.sc csPython unit 3 m.sc cs
Python unit 3 m.sc cs
 
Lists
ListsLists
Lists
 
Compiler Design- Machine Independent Optimizations
Compiler Design- Machine Independent OptimizationsCompiler Design- Machine Independent Optimizations
Compiler Design- Machine Independent Optimizations
 
Class, object and inheritance in python
Class, object and inheritance in pythonClass, object and inheritance in python
Class, object and inheritance in python
 
Python programming : Classes objects
Python programming : Classes objectsPython programming : Classes objects
Python programming : Classes objects
 
File handling in Python
File handling in PythonFile handling in Python
File handling in Python
 
Lect 1-class and object
Lect 1-class and objectLect 1-class and object
Lect 1-class and object
 
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYA
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYAPYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYA
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYA
 
Python Programming Essentials - M25 - os and sys modules
Python Programming Essentials - M25 - os and sys modulesPython Programming Essentials - M25 - os and sys modules
Python Programming Essentials - M25 - os and sys modules
 
file handling c++
file handling c++file handling c++
file handling c++
 
File concept and access method
File concept and access methodFile concept and access method
File concept and access method
 

Destacado

Interprocess communication
Interprocess communicationInterprocess communication
Interprocess communicationSushil Singh
 
Chapter 4 a interprocess communication
Chapter 4 a interprocess communicationChapter 4 a interprocess communication
Chapter 4 a interprocess communicationAbDul ThaYyal
 
Inter-Process Communication in distributed systems
Inter-Process Communication in distributed systemsInter-Process Communication in distributed systems
Inter-Process Communication in distributed systemsAya Mahmoud
 
Interprocess Communication
Interprocess CommunicationInterprocess Communication
Interprocess CommunicationDeepak H L
 
Distributed Systems
Distributed SystemsDistributed Systems
Distributed SystemsRupsee
 

Destacado (7)

Interprocess communication
Interprocess communicationInterprocess communication
Interprocess communication
 
Chapter 4 a interprocess communication
Chapter 4 a interprocess communicationChapter 4 a interprocess communication
Chapter 4 a interprocess communication
 
Inter-Process Communication in distributed systems
Inter-Process Communication in distributed systemsInter-Process Communication in distributed systems
Inter-Process Communication in distributed systems
 
Internet Protocols
Internet ProtocolsInternet Protocols
Internet Protocols
 
Interprocess Communication
Interprocess CommunicationInterprocess Communication
Interprocess Communication
 
Distributed System
Distributed System Distributed System
Distributed System
 
Distributed Systems
Distributed SystemsDistributed Systems
Distributed Systems
 

Similar a Unit 3

Unit 8
Unit 8Unit 8
Unit 8siddr
 
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux KernelThe TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux KernelDivye Kapoor
 
File Management in C
File Management in CFile Management in C
File Management in CPaurav Shah
 
Programming in C
Programming in CProgramming in C
Programming in Csujathavvv
 
Chapter 3
Chapter 3Chapter 3
Chapter 3lopjuan
 
Building File Systems with FUSE
Building File Systems with FUSEBuilding File Systems with FUSE
Building File Systems with FUSEelliando dias
 
Programming in C Session 4
Programming in C Session 4Programming in C Session 4
Programming in C Session 4Prerna Sharma
 
file handling1
file handling1file handling1
file handling1student
 
Data File Handiling File POINTERS IN C++
Data File Handiling File POINTERS IN C++Data File Handiling File POINTERS IN C++
Data File Handiling File POINTERS IN C++subham sahu
 
Advance C Programming UNIT 4-FILE HANDLING IN C.pdf
Advance C Programming UNIT 4-FILE HANDLING IN C.pdfAdvance C Programming UNIT 4-FILE HANDLING IN C.pdf
Advance C Programming UNIT 4-FILE HANDLING IN C.pdfsangeeta borde
 
EASY UNDERSTANDING OF FILES IN C LANGUAGE.pdf
EASY UNDERSTANDING OF FILES IN C LANGUAGE.pdfEASY UNDERSTANDING OF FILES IN C LANGUAGE.pdf
EASY UNDERSTANDING OF FILES IN C LANGUAGE.pdfsudhakargeruganti
 
Introduction to Kernel Programming
Introduction to Kernel ProgrammingIntroduction to Kernel Programming
Introduction to Kernel ProgrammingAhmed Mekkawy
 

Similar a Unit 3 (20)

Unix-module3.pptx
Unix-module3.pptxUnix-module3.pptx
Unix-module3.pptx
 
Unit 8
Unit 8Unit 8
Unit 8
 
Linux
LinuxLinux
Linux
 
Sysprog 16
Sysprog 16Sysprog 16
Sysprog 16
 
Unit5 C
Unit5 C Unit5 C
Unit5 C
 
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux KernelThe TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux Kernel
 
File Management in C
File Management in CFile Management in C
File Management in C
 
File management
File managementFile management
File management
 
Programming in C
Programming in CProgramming in C
Programming in C
 
Programming in C
Programming in CProgramming in C
Programming in C
 
C Programming Project
C Programming ProjectC Programming Project
C Programming Project
 
Chapter 3
Chapter 3Chapter 3
Chapter 3
 
Building File Systems with FUSE
Building File Systems with FUSEBuilding File Systems with FUSE
Building File Systems with FUSE
 
Linux filesystemhierarchy
Linux filesystemhierarchyLinux filesystemhierarchy
Linux filesystemhierarchy
 
Programming in C Session 4
Programming in C Session 4Programming in C Session 4
Programming in C Session 4
 
file handling1
file handling1file handling1
file handling1
 
Data File Handiling File POINTERS IN C++
Data File Handiling File POINTERS IN C++Data File Handiling File POINTERS IN C++
Data File Handiling File POINTERS IN C++
 
Advance C Programming UNIT 4-FILE HANDLING IN C.pdf
Advance C Programming UNIT 4-FILE HANDLING IN C.pdfAdvance C Programming UNIT 4-FILE HANDLING IN C.pdf
Advance C Programming UNIT 4-FILE HANDLING IN C.pdf
 
EASY UNDERSTANDING OF FILES IN C LANGUAGE.pdf
EASY UNDERSTANDING OF FILES IN C LANGUAGE.pdfEASY UNDERSTANDING OF FILES IN C LANGUAGE.pdf
EASY UNDERSTANDING OF FILES IN C LANGUAGE.pdf
 
Introduction to Kernel Programming
Introduction to Kernel ProgrammingIntroduction to Kernel Programming
Introduction to Kernel Programming
 

Más de siddr

Unit 7
Unit 7Unit 7
Unit 7siddr
 
Unit 6
Unit 6Unit 6
Unit 6siddr
 
Unit 5
Unit 5Unit 5
Unit 5siddr
 
Unit 4
Unit 4Unit 4
Unit 4siddr
 
Unit 2
Unit 2Unit 2
Unit 2siddr
 
Unit 1
Unit 1Unit 1
Unit 1siddr
 

Más de siddr (6)

Unit 7
Unit 7Unit 7
Unit 7
 
Unit 6
Unit 6Unit 6
Unit 6
 
Unit 5
Unit 5Unit 5
Unit 5
 
Unit 4
Unit 4Unit 4
Unit 4
 
Unit 2
Unit 2Unit 2
Unit 2
 
Unit 1
Unit 1Unit 1
Unit 1
 

Unit 3

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.