File System

Table of Contents

Overview

By using the file system in our Operating System we can store data in files and create directories for grouping files into collections. We can create hierarchies with directories by creating directories inside other directories. Each file and directory has a name that indicates its contents. File names have extensions, such as .txt, .jpg or .png, that are part of the file name and used to indicate different file types. It is a convention to use a certain extension with a certain file type, but systems do not strictly enforce them. Furthermore, we need to distinguish between two classes of files; text files and binary files.

Text Files

Text files are human-readable files that contain natural and formal language, and we can open, read and modify them using any text editor. A text file is a simple, easy-to-use, general-purpose file format representing many types of files, including source code, configuration files, and data files. For example, you might encounter .txt plain text files, .jl Julia code files and .yml YAML data-serialization files. Formal languages, such as code and data files, have predefined syntax, which machines interpret to read data or execute code. We cover more about formal languages in the Programming chapter.

Binary Files

Binary files are machine-readable files stored in binary format which require specific software for opening and modifying them. Binary files are specialized file formats that can offer more efficient encoding for large files such as media files like images .jpg, .png, video .mp4, and audio .mp3.

An executable file is a binary file that contains machine instructions that execute a program when opened. Software vendors often distribute compiled programs as executable files, often without a file extension in Linux and as .exe in Windows.

Packages

A package is an essential computer-related concept. Generally, we define a package as a collection of files associated with one another to serve some function. For example, a package could contain configuration files, source code, and media files where the configuration files would specify how a machine executes the source code and displays the media files to users. In practice, we can create a package by creating a directory named as project and add only project files inside the directory. We discuss packages more concretely in later chapters.

Previous
Next