SlideShare uma empresa 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]

Mais conteúdo relacionado

Mais procurados (20)

File Handling In C++(OOPs))
File Handling In C++(OOPs))File Handling In C++(OOPs))
File Handling In C++(OOPs))
 
Files in c++ ppt
Files in c++ pptFiles in c++ ppt
Files in c++ ppt
 
File handling-c
File handling-cFile handling-c
File handling-c
 
Enums in c
Enums in cEnums in c
Enums in c
 
Union in c language
Union  in c languageUnion  in c language
Union in c language
 
Byte stream classes.49
Byte stream classes.49Byte stream classes.49
Byte stream classes.49
 
Finite automata
Finite automataFinite automata
Finite automata
 
Intermediate code generation1
Intermediate code generation1Intermediate code generation1
Intermediate code generation1
 
Files in c++
Files in c++Files in c++
Files in c++
 
file system in operating system
file system in operating systemfile system in operating system
file system in operating system
 
File handling in c
File handling in cFile handling in c
File handling in c
 
File system Os
File system OsFile system Os
File system Os
 
File Management in C
File Management in CFile Management in C
File Management in C
 
Python file handling
Python file handlingPython file handling
Python file handling
 
File handling in c++
File handling in c++File handling in c++
File handling in c++
 
cpp input & output system basics
cpp input & output system basicscpp input & output system basics
cpp input & output system basics
 
vb.net Constructor and destructor
vb.net Constructor and destructorvb.net Constructor and destructor
vb.net Constructor and destructor
 
Constructor and Destructor
Constructor and DestructorConstructor and Destructor
Constructor and Destructor
 
Ipc in linux
Ipc in linuxIpc in linux
Ipc in linux
 
Java interfaces
Java interfacesJava interfaces
Java interfaces
 

Destaque

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
 

Destaque (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
 

Semelhante 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
 
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
 

Semelhante 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
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
 
File Organization
File OrganizationFile Organization
File Organization
 

Mais 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
 

Mais 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.