Practical System Programming for Rust by Prabhu Eshwarla
Author:Prabhu Eshwarla
Language: eng
Format: mobi
Publisher: PACKT Publishing Pvt. Ltd.
Published: 2020-12-22T16:00:00+00:00
Understanding Linux system calls for file operations
In this section, we will look at the terminology and basic mechanisms associated with managing file system resources at the operating system level. We will use Linux/Unix as an example, but similar concepts apply to other operating systems.
So, what do you think a file is?
A file is just a set of bytes. A byte represents a unit of informationâit can be a number, text, video, audio, image, or any other such digital content. The bytes are organized in a linear array called a byte stream. There is no other expectation in terms of the structure or contents of a file, as far as the operating system is concerned. It is the user application that does the interpretation of the file and its contents.
A user application is a program that is not a part of the operating system kernel. An example of a user application is an image viewer that interprets the bytes of data as an image. Since files are resources that are managed by the operating system, any user programs that we write must know how to interact with the operating system through system calls. A file can be read from, written to, or executed. An example of a file that can be executed is the binary executable (object) file, generated by software build systems such as Make or Cargo.
Another aspect that is unique to Linux/Unix is the philosophy that everything is a file. Here, everything refers to system resources. There can be many types of files on Linux/Unix:
Regular files, which we use to store text or binary data
Directories, which contain listings of names and references to other files
Block device files, for example, a hard disk, a tape drive, USB cameras
Character device files, for example, a terminal, a keyboard, a printer, a sound card
Named pipes, an in-memory inter-process communication mechanism
Unix domain sockets, also a form of inter-process communication
Links, such as hard links and symbolic links
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7808)
Grails in Action by Glen Smith Peter Ledbrook(7719)
Azure Containers Explained by Wesley Haakman & Richard Hooper(6818)
Configuring Windows Server Hybrid Advanced Services Exam Ref AZ-801 by Chris Gill(6817)
Running Windows Containers on AWS by Marcio Morales(6336)
Kotlin in Action by Dmitry Jemerov(5090)
Microsoft 365 Identity and Services Exam Guide MS-100 by Aaron Guilmette(5057)
Combating Crime on the Dark Web by Nearchos Nearchou(4631)
Microsoft Cybersecurity Architect Exam Ref SC-100 by Dwayne Natwick(4588)
Management Strategies for the Cloud Revolution: How Cloud Computing Is Transforming Business and Why You Can't Afford to Be Left Behind by Charles Babcock(4437)
The Ruby Workshop by Akshat Paul Peter Philips Dániel Szabó and Cheyne Wallace(4321)
The Age of Surveillance Capitalism by Shoshana Zuboff(3979)
Python for Security and Networking - Third Edition by José Manuel Ortega(3883)
The Ultimate Docker Container Book by Schenker Gabriel N.;(3541)
Learn Windows PowerShell in a Month of Lunches by Don Jones(3528)
Learn Wireshark by Lisa Bock(3505)
Mastering Python for Networking and Security by José Manuel Ortega(3376)
Mastering Azure Security by Mustafa Toroman and Tom Janetscheck(3355)
Blockchain Basics by Daniel Drescher(3324)
