Practical System Programming for Rust Developers by Prabhu Eshwarla
Author:Prabhu Eshwarla
Language: eng
Format: epub
Publisher: PACKT Publishing Pvt. Ltd.
Published: 2020-12-23T00: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.
2021 Beginners Guide to Python Programming Language: A Crash Course to Mastering Python in One Hour by Elmer Gary & Elmer Gary(1830)
API Testing and Development with Postman by Dave Westerveld(1540)
Learning C# by Developing Games with Unity 2020 by Harrison Ferrone(1504)
Machine Learning for Algorithmic Trading by Stefan Jansen(1469)
Software Architecture for Busy Developers by Stéphane Eyskens(1460)
Hands-On ROS for Robotics Programming by Bernardo Ronquillo Japón(1440)
Delphi GUI Programming with FireMonkey by Andrea Magni(1300)
Cloud Native with Kubernetes by Alexander Raul(1269)
Game Development Projects with Unreal Engine by Hammad Fozi & Goncalo Marques & David Pereira & Devin Sherry(1253)
Automate It with Zapier by Kelly Goss(1222)
Software Architecture Patterns for Serverless Systems by John Gilbert(1217)
Datadog Cloud Monitoring Quick Start Guide by Thomas Kurian Theakanath(1194)
Practical System Programming for Rust Developers by Prabhu Eshwarla(1192)
Practical Node-RED Programming by Taiji Hagino(1182)
Mastering React Test-Driven Development by Daniel Irvine(1164)
Delphi Programming Projects by William Duarte(1158)
Ghidra Software Reverse Engineering for Beginners by A. P. David(1124)
Learn Spring for Android Application Development by S. M. Mohi Us Sunnat(1123)
Developing Multi-Platform Apps with Visual Studio Code by Ovais Mehboob Ahmed Khan & Khusro Habib & Chris Dias(1119)