The file system folder structure is. The simplest examples of file search. File systems. File system structure

To understand how I function computer systems, it is not enough to simply interact with the operating system at a visual level. To fully understand all the processes occurring in the system, it is necessary to understand what a file and file structure are. When reviewing this topic, it will be indicated why this is needed.


What is a file and file structure?

First you need to define the basic concepts and terms. The key concept here is the file. It defines the mechanism of operation of the system in programmatically. A file is an object that contains certain information. To understand what data files and file structure are, it is better to give an example from life. You can compare these concepts with a regular book. Every person probably knows that a book has a cover, pages, table of contents, sections and chapters.

To simplify the understanding of the issue, let's say that the cover represents the entire file system in its entirety, pages are folders or directories in which individual files are stored, table of contents is a file manager, sections and chapters are files that contain specific information. The designation of an object called a file usually consists of two parts: a name and an extension. The file name can be set to various languages and be arbitrary. An extension is called special designation, indicating the data type.

The extension usually consists of three or more Latin letters. By extension, you can understand which program the file is associated with and whether it is a system one. By default, in any operating system, the file is opened double click mice. However, you won't necessarily be able to open any file this way. Let's give a simple example: in this way you can run executable files with the .exe extension in the Windows operating system, however, files with the .dll extension cannot be opened this way.

This is because the content is accessed through other software components. In addition, the code can be called by specialized operating system components. However, this is the simplest example. Objects that do not match either the operating system or any program are not so easy to open. The operating system does not understand which tool needs to be launched to open the file. In the best case, the system will prompt you to choose the appropriate program from the presented list of solutions.

Computer science at the beginning of the development of computer technology

Let's now see what information technology was like when the first computers appeared. The main system that was used in those days was the DOS system, which was primitive at that time. In this system, to access functions you had to enter special teams. After the appearance unique product Norton Commander no longer requires this, although some commands still need to be specified. This file manager can be called a table of contents, since all the information that is stored on external media or hard drive, it was clearly structured.

Folders and files

As has already become clear, in any operating system there are several main objects. Concepts such as file and file system are inseparable from the concept of folders. This concept is sometimes also called a directory or directory. It is a special section that stores individual components. To explain this concept, we can give as an example a chest of drawers, in which there are many drawers, each of which contains something.

File search examples

Based on the above, we can draw a conclusion about quick search information. Any modern operating system provides for this purpose special means. So, for example, in the same file manager in a special field you need to enter the name or part of the file name, after which the system will display all objects that contain this line. To implement more precise search you need to know where exactly the file you need is located. In other words, you need to select a specific drawer in the chest of drawers in which the desired item is located. The search is carried out using a standard file manager tool. You can also use keyboard shortcuts like Ctrl+F, which bring up the search bar.

What is a file system?

File structures and files cannot be imagined without understanding the principle of operation of the file system. It is worth noting that file structure and file system are different concepts. Outline is the basic type of file arrangement when we're talking about about data systematization. The file system is a method that defines how a structure works. Simply put, this is the principle of processing data in the sense of its placement on a storage medium. Today there are many file systems. For the Windows operating system, the most common options are FAT systems with 6, 16, 32 and 64 bit architecture, ReFS and NTFS.

The concepts of file system and file structure are closely interrelated. However, now a few words should be said about the systems themselves. If we don't talk about technical details, then it should be noted that the main difference is that the FAT file system has larger size cluster for accelerated access and storage of small files, NTFS and ReFS file systems are optimized for large amounts of data and quick access to them on maximum speed reading information from hard drive.

Performing file operations

Let's look at this issue from the other side. Typically, file operations provided for in any operating system are fundamentally no different. Basic operations include creating, viewing, opening, saving, editing, copying, renaming, deleting, and moving. For all existing operating systems such actions are standard. But there are also a number of specific functions.

Archiving information

First of all, specific functions include compression of folders and files, which is called archiving, and the reverse process - extracting information from the archive. While working on the operating system DOS creation archival data types was reduced mainly to the use of the ARJ standard, however, with the advent of ZIP archiving technology, these processes received greater development. As a result, a universal RAR archiver was created. These technologies are now available in any operating system, even without the need to install additional software. File operations in this view are treated as virtual compression. Compression technologies simply instruct the system to determine a smaller size instead of the desired one. The information volume of a folder or file remains unchanged during the archiving process.

File display control

Such a concept as file structure must be considered from the point of view of the possibility of seeing the objects themselves. Almost all users of modern computer systems today have encountered the concept of hidden files and folders. What are they? The presence of such objects indicates that the system has certain limitation to display. For example, such restrictions are set on system files and folders to prevent the user from accidentally deleting them. Thus, they do not physically disappear from the hard drive, it’s just that the file manager does not recognize them. To display all hidden objects in the same “Explorer” you can use the “View” menu.

On the corresponding tab, you need to check the box in the line for displaying hidden files and folders. After enabling display, objects of this type will have translucent icons. There may be some difficulties in finding hidden objects. The system may not return search results even if you enter a file name and type, as well as a specific location. To find hidden objects, you need to put a % symbol at the beginning and end of the name of the root directory. Only in this case will the file and the file structure receive the key to interaction.

The file system allows you to organize programs and data and organize orderly management of these objects.

The concept of the file system underlying the Unix OS left a deep imprint on personal computer operating systems. In Unix, the I/O subsystem unifies the way both files and peripheral devices are accessed. A file is understood as a set of data on a disk, terminal or some other device.

The file system is a functional part of the operating system that allows operations on files. The file system allows you to work with files and directories (directories) regardless of their content, size, type, etc.

A file system is a data management system.

A data management system is a system in which users are freed from most physical file manipulation and can focus primarily on the logical properties of the data.

OS file systems create for users some kind of virtual representation of external storage devices, allowing them to work not at a low level of physical device control commands, but at a high level of data sets and structures.

File system (purpose):

  • hides the picture of the real location of information in external memory;
  • ensures the independence of programs from the specific configuration of the computer (logical level of working with files);
  • provides standard responses to errors that occur during data exchange.

File structure

The entire collection of files on the disk and the relationships between them is called the file structure. Developed operating systems have a hierarchical - multi-level file structure, organized in the form of a tree.

Tree file structure

A tree directory structure is used – a directory tree. Borrowed from Unix. Hierarchical structure is the structure of a system, the parts (components) of which are connected by relationships of inclusion or subordination.

The hierarchical structure is represented by an oriented tree in which vertices correspond to components, and arcs correspond to connections.

G drive directory tree

A directed tree is a graph with a selected vertex (root), in which between the root and any vertex there is the only way. In this case, two orientation options are possible: either all paths are oriented from the root to the leaves, or all paths are oriented from the leaves to the root.

Trees are used to describe and design hierarchical structures.

The root is the starting position, the leaves are the final position.

Sections

During the formatting process, any hard or magneto-optical disk can be divided into several parts and treated as separate (independent) disks. These parts are called partitions or logical drives. Partitioning a disk into several logical drives may be necessary because the operating system cannot handle disks larger than a certain size. It is very convenient to store data and user programs separately from system programs(OS), because the OS can “fly off the computer.”

A partition is an area of ​​a disk. A logical disk (partition) in a computer is any storage medium with which the operating system works as a single entity.

Disk name - designation logical drive; entry to root directory.

Logical drives (partitions) are designated by Latin letters A, B, C, D, E, ... (32 letters from A to Z).

The letters A, B are reserved for floppies.

C is the hard drive from which the OS is usually loaded.

The remaining letters are logical drives, CDs, etc. Maximum amount logical drives for Windows OS - endless.

The partition table specifies the location of the beginning and end of that partition and the number of sectors in that partition (space and size).

File structure of a logical drive

To access information on the disk contained in a file, you need to know the physical address of the first sector (surface number + track number + sector number), the total number of clusters occupied by this file, the address of the next cluster if the file size is larger than the size of one cluster

File structure elements:

    start sector (boot sector, Boot sector);

    file allocation table (FAT – File Allocation Table);

    root directory (Root Directory);

    data area (remaining free disk space).

File structure on a 360 KB floppy disk

Boot sector is the first (initial) sector of the disk. Located on the 0-side, 0-track.

The boot sector contains service information:

    disk cluster size (cluster is a block that combines several sectors into a group to reduce the size of the FAT table);

    location of the FAT table (in the boot sector there is a pointer to where the FAT table is located);

    FAT table size;

    number of FAT tables (there are always at least 2 copies of the table to ensure reliability and security, since destruction of FAT leads to loss of information and is difficult to recover);

    the address of the beginning of the root directory and its maximum size.

The boot sector contains the boot block (bootloader) - the Boot Record.

The loader is a utility program that places the executable program in RAM and brings it into a state of readiness for execution.

FAT (File Allocation Table)

FAT (File Allocation Table) – file allocation table. It defines which areas of the disk belong to each file. The data area of ​​the disk is represented in the OS as a sequence of numbered clusters.

FAT is an array of elements that address clusters of the disk's data area. Each data area cluster corresponds to one FAT element. FAT elements serve as a chain of references to file clusters in the data area.

FAT consists of 16/32/64 bit elements. In total, the table can contain up to 65520 such elements, each of them (except the first two) corresponds to a disk cluster. A cluster is a unit that allocates space in a data area on a disk for files and directories. The first two table elements (numbered 0 and 1) are reserved, and each of the remaining table elements describes the state of the disk cluster with the same number. The element may indicate that the cluster is free, that the cluster is defective, that the cluster belongs to the file and is the last cluster in the file. If a cluster belongs to a file and is not its last cluster, then the table element contains the number of the next cluster in this file.

FAT is an extremely important element of the file structure. Violations in FAT can lead to complete or partial loss of information on the entire logical drive. That is why two copies of FAT are stored on the disk. Exist special programs, which monitor the status of FAT and correct violations.

Required for different OS different versions FAT

Windows 95 FAT 16, FAT 32

Windows NT (XP) NTFS

Novell Netware TurboFAT

UNIX NFS,ReiserFS

Logical structure of the storage medium

Full information clusters that occupy files are contained in the allocation table FAT files(FAT - File Allocation Table).

The number of FAT cells corresponds to the number of clusters on the disk, and the values ​​of the cells are the file placement chains, i.e. sequences of addresses of clusters in which files are stored..

For example, for the files File_1 and File_2, the FAT table from the 1st to the 54th cell takes the form:

FAT fragment

This is a specific area of ​​the disk created during the initialization (formatting) process of the disk, which contains information about the files and directories stored on the disk. The root directory always exists on a formatted disk.

It is not nested in any other directories, it is the directory itself top level

There is only one root directory on one disk

A directory is a named collection of files and subdirectories (i.e., subdirectories).

A directory (folder) is a special place on a disk in which information about the location of files is stored.

The directory stores information about files and subdirectories - name, size, date and time latest update and so on.

Each directory has a name and it can be registered in another directory.

The main purpose of this directory structure is to organize efficient storage large quantity files on disk.

Subdirectory is a directory at a lower level (nested) in relation to the current directory.

Current directory (folder) – the directory with which the user is currently working (viewing the contents of the directory).

example of the file structure of drive C

Let's go to next topic to the main element of the file system - FILE

How to install such buttons?
Let's be friends!

computercnulja.ru

Files and file structures - Computer science at school

Logical names of external memory devices

Each computer can have multiple external memory devices connected. The main external memory device of a PC is the hard drive. If the hard drive has a sufficiently large capacity, then it is divided into several logical partitions.

Having multiple logical partitions on one hard drive provides the user with the following benefits:

You can store the operating system on one logical partition and data on another, allowing you to reinstall the operating system without affecting the data;

You can install different operating systems on one hard drive in different logical partitions;

Maintenance of one logical partition does not affect other partitions.

Each external memory device connected to the computer, as well as each logical partition of the hard drive, has a logical name.

The Windows operating system accepts logical names for external memory devices, consisting of one Latin letter and a colon:

For floppy disk drives (floppy disks) - A: and B:;

For hard drives and their logical sections - C:, D:, E:, etc.;

For optical drives- names following the alphabetical order after the name of the last hard drive or hard drive partition on the computer (for example, F:);

For flash memory connected to a computer, the name following the last name of the optical drive (for example, G:).

In the operating room Linux system Other rules for naming disks and their partitions have been adopted.

For example:

Logical partitions belonging to the first hard drive, get names hdal, hda2, etc.;

Logical partitions belonging to the second hard drive are named hdbl, hdb2, etc.

All programs and data are stored in the external memory of the computer in the form of files.

A file is a named area of ​​external memory.

The file system is a part of the OS that determines the way files are organized, stored, and named on storage media.

The file is characterized by a set of parameters (name, size, creation date, date latest modification) and the attributes used by the operating system to process it (archive, system, hidden, read-only). The file size is expressed in bytes.

The file name usually consists of two parts separated by a dot: the actual file name and the extension. The actual name of the file is given by the user. It is recommended to do this meaningfully, reflecting the contents of the file in the name, although the user can specify random dial characters. The name extension is usually set automatically by the program when creating the file. Extensions are not required, but they are widely used. The extension allows the user, without opening the file, to determine its type - what type of information (program, text, drawing, etc.) it contains. The extension allows the operating system to automatically open the file.

In modern operating systems, the file name can include up to 255 characters, and it can use letters of national alphabets and spaces. The file name extension is written after a period and usually contains 3-4 characters.

On Windows, the following characters are prohibited in file names: \, /, :, *, ?, ", |. On Linux, these characters except / are allowed, although they should be used with caution, as some of them may have special meanings , as well as for reasons of compatibility with other operating systems.

The Linux operating system, unlike Windows, distinguishes between lowercase and uppercase letters in a file name: for example, FILE.txt, file.txt and FiLe.txt are three different files in Linux.

The table shows the most common file types and their extensions:

In Linux OS there are following types files:

Regular files are files with programs and data;

Directories - files containing information about directories;

Device special files - files used for presentation physical devices computer (hard and optical drives, printer, speakers etc.).

Catalogs

Each computer storage medium (hard drive, optical disk, or flash memory) can store a large number of files. To make it easier to find information, files are grouped according to certain characteristics into groups called directories or folders.

The directory also gets its own name. It itself can be part of another directory external to it. Each directory can contain many files and subdirectories.

A directory is a named collection of files and subdirectories (subdirectories).

The top-level directory is called the root directory.

In Windows OS any information carrier has a root directory that is created by the operating system without user intervention. Root directories are designated by adding a “\” sign to the logical name of the corresponding external memory device ( backslash): A:\, C:\, D:\, E:\, etc.

In Linux, directories on hard drives or their logical partitions do not belong to the top level of the file system (they are not brown directories). They are "mounted" into the mnt directory. Other external storage devices (floppy, optical, and flash drives) are “mounted” in the media directory. The mnt and media directories, in turn, are “mounted” into a single root directory, which is denoted by the “/” sign (forward slash).

Disk file structure

The file structure of a disk is a collection of files on the disk and the relationships between them.

File structures can be simple or multi-level (hierarchical).

Simple file structures can be used for disks with a small (up to several dozen) number of files. In this case, the disk table of contents is a linear sequence of file names (Fig. 2.8). It can be compared to the table of contents of a children's book, which contains the names of the stories included in it and page numbers.

Hierarchical file structures are used to store large (hundreds and thousands) of files. Hierarchy is the arrangement of parts (elements) of a whole in order from highest to lowest. The initial (root) directory contains first-level files and subdirectories. Each of the first-level directories can contain files and subdirectories of the second level, etc. (Fig. 2.9). In this case, the table of contents of the disk can be compared with the table of contents of our textbook: it contains chapters consisting of paragraphs, which, in turn, are divided into separate paragraphs, etc.

The user, by combining files into directories at his own discretion, has the opportunity to create a convenient information storage system. For example, you can create separate directories for storing text documents, digital photos, melodies, etc.; in the photo catalog, combine photos by year, event, affiliation, etc. Knowing which directory a file belongs to makes searching for it much faster.

Graphic image hierarchical file structure is called a tree. On Windows, directories on different drives can form several separate trees; in Linux, directories are combined into one tree, common to all disks (Fig. 2.10). Tree-like hierarchical structures can be depicted vertically and horizontally.

Full file name

To access the desired file stored on a certain disk, you can specify the path to the file - the names of all directories from the root to the one in which the file itself is located.

In the operating system Windows path to the file begins with the logical name of the external memory device; Each subdirectory name is followed by a backslash. In the Linux operating system, the file path begins with the name of the single root directory; Each subdirectory name is followed by a forward slash.

The file path and file name written down in sequence form the full file name. No two files can have the same full name.

An example of a full file name in Windows OS: E:\images\photo\Katun.jpg

Example of a full file name in Linux OS: /home/methody/text

Task 1. The user worked with the directory C:\Physics\Tasks\Kinematics. First, he went up one level, then he went up one level again, and after that he went down to the Exam directory, in which the Informatics.doc file is located. What is the path to this file?

Solution. The user worked with the directory C:\Physics\Tasks\Kinematics. Having gone up one level, the user found himself in the C:\Physics\Tasks directory. Having gone up one more level, the user found himself in the C:\Physics directory. After this, the user went down to the Exam directory, where the file is located. The full path to the file is: C:\Physics\Exam

Task 2. The teacher worked in the directory 0:\Lessons\8th grade\Practical work. Then I went up one level in the directory tree, went down to the Presentations subdirectory and deleted the Introduction.ppt file from it. What is the full name of the file that the teacher deleted?

Solution. The teacher worked with the catalog 0:\Lessons\8th grade\Practical work. Having gone up one level, it ended up in the directory B:\Lessons\8th grade. After this, the teacher went down to the Presentations directory, the path to the files of which looks like: B:\Lessons\8th grade\Presentations. In this directory, he deleted the file Introduction.ppt, the full name of which is 0:\Lessons\8th grade\Presentations\Introduction.ppt

Working with files

Files are created using programming systems and application software.

When working on files on a computer, the following operations are most often performed:

Copying (a copy of the file is created in another directory or on another medium);

Moving (the file is moved to another directory or to another medium, the original file is destroyed);

Renaming (the actual file name is renamed);

Deletion (the object in the source directory is destroyed).

When searching for a file whose name is not known exactly, it is convenient to use a file name mask. The mask is a sequence of letters, numbers and other characters allowed in file names, among which the following characters may also appear:

"?" (question mark) - means exactly one arbitrary character;

“*” (asterisk) - means any (including empty) sequence of characters of arbitrary length.

For example, using the mask n*.txt, all files with the txt extension whose names begin with the letter “n” will be found, including the file n.txt. Using the mask n?.*, files with arbitrary extensions and two-letter names starting with the letter “n” will be found.

THE MOST IMPORTANT

The main external memory device of a PC is the hard drive. If the hard drive has a sufficiently large capacity, then it is divided into several logical partitions. Each external memory device connected to the computer, as well as each logical partition of the hard drive, has logical names.

A file is a named area of ​​external memory. The file name usually consists of two parts separated by a dot: the actual file name and the extension.

A directory is a named collection of files and subdirectories (subdirectories). The top-level directory is called the root directory.

The file structure of a disk is a collection of files on the disk and the relationships between them. File structures can be simple or multi-level (hierarchical).

Path to the file - the names of all directories from the root to the one in which the file is located. The file path and file name written down in sequence form the full file name. The full file name is unique.

sites.google.com

§eleven. About files and file structures

Main topics of the paragraph:

what is a file?

file name;

logical drives;

disk file structure;

file path, full file name;

table of file allocation on disk.

What is a file

Information on external media is stored in the form of files. Working with files is a very important type of computer work. Everything is stored in files: both software and information necessary for the user. With files, as with business papers, you constantly have to do something: copy them from one medium to another, destroy unnecessary ones, create new ones, search for them, rename them, put them in one order or another, etc.

A file is information stored on external media and combined common name.

Each file stores a separate information object: a document, an article, a numeric array, a program, etc. The information contained in the file becomes active, i.e., can be processed by a computer, only after it is loaded into RAM,

Any user who works on a computer has to deal with files. Even in order to play a computer game, you need to find out in which file its program is stored, be able to find this file and initialize the program.

Working with files on a computer is done using the file system. The file system is a functional part of the OS that allows operations on files.

To find required file, the user must know: a) what name the file has; b) where is file1 stored?

File name

In almost all operating systems, the file name is composed of two parts separated by a dot. For example: myprog.pas

To the left of the dot is the actual file name (myprog). The part of the name following the dot is called the file extension (pas). Typically used in file names letters and numbers. In most OS maximum length extensions - 3 characters. In addition, the file name may not have an extension. In the Windows operating system, Russian letters are allowed in file names; The maximum name length is 255 characters.

The extension indicates what kind of information is stored in this file. For example, the txt extension usually denotes a text file (contains text); extension pxx - graphic file (contains a picture), zip or gag - archive file (contains archive - compressed information), pas - program in Pascal.

Logical drives

One computer can have several disk drives - devices for working with disks. Each drive is assigned a single letter name (followed by a colon), for example A:, B:, C:. Often on personal computers there is a large capacity disk built into the system unit (it is called hard drive), divided into sections. Each of these partitions is called a logical disk, and it is assigned the name C:, D:, E; etc. The names A: and B: usually refer to replaceable disks small volume - flexible disks (floppy disks). They can also be considered as names of disks, only logical ones, each of which completely occupies a real (physical) disk. Therefore, A:, B:, C:, D: are all names of logical drives,

The name of the logical drive containing the file is the first "coordinate" that determines the location of the file.

Disk file structure

The entire collection of files on the disk and the relationships between them is called the file structure. Different operating systems may support different file structure organizations. There are two types of file structures: simple, or single-level, and hierarchical - multi-level.

A single-level file structure is a simple sequence of files. To find a file on disk, you just need to specify the file name. For example, if the tetris.exe file is located on drive A:, then its “full address” looks like this:

Operating systems with a single-level file structure are used in the simplest educational computers equipped with floppy disks only.

A multi-level file structure is a tree-like (hierarchical) way of organizing files on a disk. To facilitate understanding of this issue, we will use an analogy with the traditional “paper” method of storing information. In this analogy, a file is represented as some titled document (text, drawing) on ​​paper sheets. The next largest element of the file structure is called a directory. Continuing the “paper” analogy, we will think of a directory as a folder into which you can put many documents, i.e., files. The directory also gets its own name (think of it on the cover of a folder).

The directory itself can be part of another directory external to it. This is similar to nesting a folder inside another larger folder. Thus, each directory can contain many files and subdirectories (called subdirectories). The top-level directory that is not nested within any other directory is called the root directory.

In the Windows operating system, the term “folder” is used to refer to the concept of “directory.”

A graphical representation of a hierarchical file structure is called a tree.

In Fig. 2.9 directory names are written in capital letters, and file names are written in lowercase letters. Here in the root directory there are two folders: IVANOV and PETROV and one file fin.com. The IVANOV folder contains two subfolders PROGS and DATA. The DATA folder is empty; in the PROGS folder there are three files, etc. In the tree, the root directory is usually represented by the symbol \.

The path to the file

Now imagine that you need to find a specific document. To do this, you need to know the box in which it is located, as well as the “path” to the document inside the box: the entire sequence of folders that need to be opened to get to the papers you are looking for.

The second coordinate that determines the location of the file is the path to the file on disk. The path to a file is a sequence consisting of directory names starting from the root one and ending with the one in which the file is directly stored.

Here is the familiar fairy-tale analogy of the concept “path to file “There is a chest hanging on an oak tree, in the chest there is a hare, in the hare there is a duck, in the duck there is an egg, in the egg there is a needle, at the end of which is Koshcheev’s death.”

The logical drive name, file path, and file name written down in sequence form the full file name.

If shown in Fig. 2.9 file structure is stored on the C: drive, then the full names of some of the files included in it are in operating symbols MS-DOS systems and Windows look like this:

File Allocation Table

Information about the file structure of the Disk is contained on the same disk in the form of a file allocation table. Using the OS file system, the user can sequentially view the contents of directories (folders) on the screen, moving down or up the file structure tree.

In Fig. Figure 2.10 shows an example of displaying a directory tree on logical drive E: on a computer screen (left window).

The right window shows the contents of the ARCON folder. That's a lot of files various types. Hence, for example, it is clear that the full name of the first file in the list is as follows:

From the table you can get additional information about the files. For example, the file dos4gw.exe is 254,556 bytes in size and was created on May 31, 1994 at 2:00 am.

Having found an entry about the desired file in such a list, using OS commands, the user can perform various actions with it: initialize the program contained in the file; delete, rename, copy file. You will learn how to perform all these operations in a practical lesson.

Briefly about the main thing

A file is information stored on external media and united by a common name.

The file system is a functional part of the OS that allows operations with files.

The file name consists of the actual name and extension. The extension indicates the type of information in the file (file type).

The file structure of a disk is a collection of files on the disk and the relationships between them. File structures can be simple or multi-level (hierarchical).

A directory is a named collection of files and subdirectories (subdirectories). The top-level directory is called the root directory. It is not nested in any directories.

The full file name consists of the drive name, the path to the file on the drive, and the file name.

Questions and tasks

1.What is the name of the operating system used in your computer class?

2.What file structure does the operating system use on your computers (simple, multi-level)?

3.How many physical drives do your computers have? How many logical disks are there on physical disks and what names do they have in the operating system?

4.What rules do file names follow in your OS?

5.What is the path to the file on the disk, the full file name?

6.Learn (under the guidance of a teacher) to view disk directories on your computers on the screen.

7.Learn to initialize programs from program files ( exe type, com).

8.Learn to do the basics file operations in the OS used (copying, moving, deleting, renaming files).

txtbooks.ru

File and file structure. File Operations

In order to understand the principles by which computer systems operate, it is not enough to simply interact with the operating system at a visual level. To fully understand everything that is happening, you should clearly understand what a file and file structure are. When considering this topic, it will be indicated why this is necessary.

The concept of file and file structure

First you need to decide on the most important terms and concepts. The key here is the concept of a file, which defines the mechanisms of the system in software terms.

So, a file is an object containing certain information. To understand what data files, file structures and their interaction are, it is better to give an example from life, say, compare these concepts with an ordinary book.

Everyone knows that in almost any book you can find a cover, pages, table of contents, chapters and sections. For the simplest understanding, the cover is the entire file system in its entirety, the pages are folders (directories) in which individual files are stored, the table of contents is the file manager, chapters and sections are files containing specific information.

As a rule (not always, however), the designation of an object called a file consists of two parts: a name and an extension. Actually, the name can be absolutely arbitrary and set to different languages. An extension is a special designation of three or more Latin letters that indicates the data type. Simply put, by the extension you can understand what program the file is associated with, whether it is system, etc.

Opening a file by default in any operating system is done by double-clicking the mouse. However, it is not a fact that everything can be opened in this way. The simplest example: executable files in Windows with the extension .exe can be launched this way, but the same dynamic libraries, designated in the extension as .dll, although they contain executable codes, nevertheless cannot be opened in this way. This is only due to the fact that their contents are accessed through other software components, or the code is called by specialized components of the operating system itself. But this is the simplest example.

Files (objects) that do not correspond to either the operating system or any program will not be so easy to open. Roughly speaking, not a single “OS” will understand which opening tool needs to be launched. In the best case, you will be asked to select the appropriate program from the provided list of probable solutions.

Files and file structure: computer science at the dawn of the development of computer technology

Now let's see what information technology was like when the first computers appeared. It is believed that the main system used at that time was DOS, primitive in modern times, in which specialized commands had to be entered to access functions.

With the advent of the unique brainchild Norton Commander, this need not only disappeared (some commands still needed to be registered), but rather decreased. It is this file manager, based on our example, that can be called a table of contents, since all the data stored on the hard drive or external storage device was clearly structured.

Files and folders

As is already clear, in any system there are several main types of objects. The file and file structure, in addition to the main element (the file), are inseparable from the concept of a folder. Sometimes this term denoted as "directory" or "directory". Essentially, this is a section in which individual components are stored.

In principle, not to mention book pages, the concept of a folder can be expressed most clearly if you look at some chest of drawers with many drawers in which something lies. This “something” is files, and the boxes are directories.

The simplest examples of file search

Based on the above, we can draw a conclusion about quickly searching for information. Any existing operating system has tools for this purpose. In the same file manager (for example, Windows Explorer), in a special field, you just need to enter at least part of the file name, after which the system will display all objects containing the entered string.

However, for a more accurate search, sometimes you need to know where exactly the file you are looking for is located. Roughly speaking, we need to select a specific drawer in the chest of drawers where the item we need is located. The search itself is performed using a standard tool in the file manager, but you can also use a combination like Ctrl + F, which brings up the search line.

What is a file system?

Files and file structures cannot be imagined without understanding the file system. Note that file structure and file system are not the same thing. Structure is the main type of organizing files, or, if you like, systematizing data, but the file system is a method that determines the operation of the structure. In other words, this is the principle of data processing in terms of its placement on a hard drive or any other storage medium.

Today you can find quite a lot of file systems. For example, the most famous for Windows since the development computer equipment steel FAT systems with 8, 16, 32 and 64 bit architecture, NTFS and ReFS. The file system, file structure, and organizing method are closely related to each other. But now a few words about the systems themselves.

Without going into technical details, it should be noted that the main difference between them is that FAT has a larger cluster size for storing and accelerating access to small files, while NTFS and ReFS are optimized for large amounts of data and quick access to them on maximum speed for reading information from the hard drive.

File Operations

Now let's look from the other side at what the file structure of operating systems is. Operations with files that are provided in any “OS”, in general, do not differ much.

The main ones include creating a file, opening, viewing, editing, saving, renaming, copying, moving, deleting, etc. Such actions are standard for all existing systems. However, there are also some specific functions.

Data archiving

Among the specific functions, first of all, we can highlight the compression of files and folders, called archiving, as well as the reverse process - extracting data from the archive. At the time of development DOS systems the creation of archival data types has largely been limited to using the ARJ standard.

But with the advent of ZIP archiving technologies, such processes have received a new development. Subsequently, a universal RAR archiver. These technologies are now available in any operating system, even without the need to install additional software. The OS file structure of file operations in this perspective is interpreted as virtual compression. Essentially, compression technologies simply instruct the system to determine not the desired size, but a smaller one. The information volume of a file or folder itself does not change during archiving.

Controlling the display of objects

The concepts of “file structure”, “file structure”, etc. should also be considered from the point of view of the possibility of seeing the objects themselves. It's no secret that almost all users of modern PCs have come across the term “hidden files and folders.”

What it is? This only means that the system has restrictions on the display of certain objects (for example, system files and folders so that the user does not accidentally delete them). That is, physically they don’t disappear from the hard drive, the file manager just doesn’t see them.

To display all hidden objects, in the same “Explorer” you should use the “View” menu, where on the corresponding tab a check mark is placed in the line for displaying all hidden folders and files. After enabling this type, objects will have translucent icons.

Finding hidden objects can also be difficult. When you enter a file name or its extension, even indicating a specific location, when the display of such objects is disabled, there will be no result (the system does not see them). In order to find them, you need to enter the % symbol at the beginning and at the end of the root folder name. For example, to search for the AppData directory, which is hidden and located in the local settings folder for a specific user, you should use the search string %USERPROFILE%\AppData. Only in this case will the file and the file structure as a whole receive the key to the relationship.

Conclusion

Here is a brief summary of all that concerns understanding the basic terms. Basically, to understand what a file and file structure is, on elementary examples not that difficult. Finally, if you want, you can define these terms as the bricks and the wall that make it up. A brick is a file, a wall is a file structure, where each brick occupies a strictly defined place, assigned only to it.

Some technical aspects or classical definitions accepted in programming and computer technologies so that the reader can understand the material at an elementary level.

fb.ru

File structure (system). File and Directory View

Methodological development lesson

One of the purposes of a computer is long-term storage of data, which is most often stored on a hard drive. Let's find out how their storage is organized.

Data is any information. Data can be called text, drawing, table. By storing certain data on disk, we assume that we will need it again someday. But how to find them later? You need to know where this data was stored, as well as the name by which to access it. To store the address and name of the disk area where specific data is stored, the concept of a file was introduced. So, a file is a named location on disk for storing data of a certain type.

There may be too many files and they may be located in different places hard drives. However, a person will hardly find it convenient to navigate the disorderly placement of files. In order to organize and systematize files, a special type of file was invented - a directory, which is a list of links to data files or other directories. If you open a directory in the operating system, you can see files and other directories that seem to be stored in it. In fact, these attachments may be located in different hard places disk, but the operating system will show them together.

Directories are often also called directories or folders. All three terms mean the same thing.

Do we get a tree?!

So, every file in the operating system must be in a directory, and also, every directory (with one exception) must be in another directory. The exception is the so-called “root directory”, where everything starts. In addition, there cannot be a situation where one directory links to a second, and that directory links back to the first.

The above can be represented as a tree, in which the trunk and branches are directories, and the leaves are files. From any branch a branch of the next order and/or leaves can grow, i.e. any directory can contain subdirectories and/or data files.

We can draw the following conclusion: the file system in the operating system is logical structure files and directories. The structure described above is often called hierarchical or tree-like. It is typical for most operating systems. However, there are some differences. So in operating systems based on Linux kernel, there is only one root directory. It is denoted by a slash character (/) and contains more than a dozen subdirectories. In OS Windows family there are as many root directories as hard sections disk available to the system.

Each file has an address!

From the structure described above, we can conclude that each file and directory must have its own address.

In the previous figure you can see that the less directory is located in the sasha directory. That, in turn, is in the home directory, which is located directly in the root directory. The address is written as follows: first the root directory “/” is written, and then the directories are indicated, starting from the topmost (parent) and ending with the bottom (child), separated by the same “/”. In our example, the address of the less directory will look like this: /home/sasha/less. The address and file name form its full name. In this case, you should remember the rule: in the operating system there cannot be two files (or directories) with the same full names.

The addressing described above is absolute (that is, the address is written starting from the root directory). In addition to absolute, relative addressing is often used, where the address entry begins not from the root directory, but relative to the current one (the one that is currently open). For example, if we, being in the sasha directory, want to go to the vaniy directory, then we should write the following address path: ../vaniy. Here two dots indicate a transition to a higher level (in in this case/home directory). If you need to go from the sasha directory to the less directory, then it will be enough to simply specify the name of this directory less; although this option would be more correct: ./less. One dot represents the current directory.

File manager is your assistant

How to navigate the directory tree, view and manage its contents? For these purposes, so-called file managers are used (modern graphical shell managers are also called browsers, because they allow you to view certain types of files).


IN graphical shell GNOME's default manager/browser is Nautilus. You can launch it through the Main Menu (Applications -> System -> File Browser) or in other ways.

Let us describe the structure of the browser window and the basic principles of navigation in it.

There are five parts to the Nautilus window. The first is the menu bar (contains the items File, Edit, View, etc.) - where you access browser commands. The second is the toolbar (Back, Forward, Up, etc. buttons) - contains the most used menu commands, implemented as buttons. Third - address bar– contains a field displaying the address of the current directory. The fourth one (from the left) is side panel– in this case, displaying a directory tree. And the fifth (largest part) is the viewing area - displays the contents of the current directory.

Let's take a look at the side panel that displays the directory tree (in addition, the panel can be configured to display information, notes, and the history of the current directory). An inverted triangle sign located next to a directory indicates that it contains other directories and/or files. If you click on this sign, the subdirectories within it will be displayed. Clicking again will close the directory structure. If you left-click directly on a directory, its contents will be displayed in the viewing area.

The Back button on the Toolbar returns us to the directory that was current before. The Up button allows you to move to the parent directory relative to the current one. The Reload button refreshes the view of the contents of the current directory (useful in cases where it is known that changes have occurred in the directory, but the browser has not yet displayed them). The Home button makes the user's home directory current (which is located at /home/username).

Besides Nautilus, there are many other file managers. For example, the default KDE desktop is Konqueror.

Navigation and file creation

Files and folders can be created in several ways. One of them is creation using the context menu. To do this, click on empty place current directory right click mouse and in the context menu select Create folder or Create document (in the latter case, a submenu appears where you select the document type). After this, the name of the object is entered.

If you need to rename an object, you can do this in the following ways: select a folder/file, then click on it with the left mouse button (not to be confused with a double click, when the clicks occur quickly one after another); select the folder/file, then press the F2 key on the keyboard;

right-click the folder/file and select Rename from the context menu that appears.

After any of these three actions, you should enter a new file name and press Enter.

Practical work. Creating files and directories

Exercise. Create the following file structure in your home directory.


Designations: ellipse – directory, rectangle – file.

Questions

  1. Why is the file system called tree-based and hierarchical?
  2. What is a file?
  3. What is the root directory in Linux? Which default directory contains user directories?
  4. What is an absolute address? relative address? In what cases is it more appropriate to use a relative address?

conclusions

  • Files are named locations on disk for storing data. The data structure may be different.
  • The directory structure of operating systems is arranged according to a hierarchical principle and has a tree structure.
  • Each file structure object has its own unique address, the entry of which starts from the root directory and ends with the desired object (file or directory). You can navigate through the directory structure using the following instructions: absolute addresses, and relative.
  • Operating systems provide various file managers to view and manage file and directory structures.
  • In addition to system files and directories, a person can create his own. You can create folders and files as in graphic mode, and with the help shell in text mode.

All programs and data are stored in the computer's long-term memory in the form of files.

Definition 1

File– a named collection of data recorded on a medium. Any file has a name consisting of two parts separated by a dot - the name itself and the extension. When specifying a file name, it is desirable that it indicates either the contents of the file or the author.

The extension indicates the type of information stored in the file. The file name is given by the user, and the file type is usually set automatically by the program when it is created.

Picture 1.

The file name can contain up to $255$ characters, including extension. The file name can consist of English and Russian letters, numbers and other symbols.

It is forbidden to use the following characters in file names:

\ / * ? : “ | .

Extension of some file types:

Figure 2.

In addition to the name and type, the file parameters are also: file size, date and time of creation, icon (elementary graphic object, you can use it to find out in what environment the file was created or what type it is).

Figure 3.

Classification of file icons

Figure 4.

Definition 2

File structure– a set of files and the relationship between them.

Single-level file structure used for disks with a small number of files and is a linear sequence of file names.

Multi-level file structure used if the disk contains thousands of files grouped into folders. Multi-level implies a system of nested folders with files.

Each disk has a logical name, denoted by a Latin letter followed by a colon:

  • C:, D:, E: etc. – hard and optical drives,
  • A:, B: - flexible disks.

The top level folder for the disk is The root folder, which in OS Windows is indicated by adding the “\” icon to the drive name, for example, D:\ is the designation of the root folder.

Example file structure:

Figure 5.

Catalog is a folder or directory where files and other directories are placed.

A directory that is not a subdirectory of any other directory is called root. This directory is at the top level of the hierarchy of all directories. In Windows, each drive has its own root directory (D:\, C:\, E:).

Directories in OS Windows are divided into system and user. Example of system directories: “Desktop”, “Network Neighborhood”, “Trash”, “Control Panel”.

Figure 6. OS Windows system directories

From left to right: system folder

Trash, My Documents folder, shortcut to the My Documents folder

A directory and a folder are physically the same thing.

The path to the file is its address.

The path to the file always begins with the logical drive name (D:\, C:\, E:), then a sequence of names of folders nested within each other is written, the last folder containing the desired file. The path to the file together with the file name is called the full file name, for example: D:\My Documents\Literature\Essay.doc full file name Essay.doc.

Figure 7. Directory and file tree

Schematically, the file structure of a disk is represented as a tree.

Figure 8. File structure of drive Z:

  • Z:\box\box1 – full name of the folder (directory) box1
  • Z:\box\box.txt – full name of the box.txt file
  • Z:\box\box2\box3\box1 - full name of the folder (directory) box1
  • Z:\box\box2\box3\box.txt - full name of the box.txt file

The purpose of the lesson: Provide an introduction to the file system and explain how it works.

Tasks lesson:

Educational: introduce students to the conceptyami « file", "file structures", consolidate the acquired knowledge;

Educational: develop the creative and mental activity of students in the classroom through the analysis of demonstration examples, the ability to generalize, quickly switch, contribute to the formation of collective and independent work, the ability to express one’s thoughts clearly and clearly;

Educational: promote the development of motor and semantic memory, skills to analyze, compare, select theoretical material,formation of search independence and communicative qualities of students.

Form of lesson organization: frontal.

Lesson method: verbal, visual and demonstration.

Lesson type: combined.

Hardware: multimedia projector, presentation.

Lesson plan:

1. Organizational moment (2 min).

2. Explanation of new material (15 min).

3. Consolidation of new material (5 min).

4. practical work (20 min).

5. Staging homework(1 min).

6. Summing up (2 min).

During the classes:

1. Organizational point: Absence control. Formulation of the topic and objectives of the lesson.

Today in class we will learn:

what is a file?

file name;

logical drives;

disk file structure;

file path, full file name.

2. Explanation of new material:

All modern operating systems provide the creation of a file system, which is designed to store data on disks in the form of files and serve to access them. It is known that files are used to organize and store data on computer media.

File (English)file ) is a sequence of bytes that has a unique name on machine media.

Information on external media is stored in the form of files. Working with files is a very important type of computer work. Everything is stored in files: and software, and information necessary for the user. With files, as with business papers, you constantly have to do something: copy them from one medium to another, destroy unnecessary ones, create new ones, search for them, rename them, put them in one order or another, etc.

A file is information stored on external media and united by a common name.

To clarify the meaning of this concept, it is convenient to use the following analogy: the storage medium itself (disk) is like a book. We talked about how a book is external memory person, and magnetic disk– external computer memory. The book consists of chapters (stories, sections), each of which has a title. The files also have their own names. These are called file names. At the beginning or end of a book there is usually a table of contents - a list of chapter titles. There is also such a directory list on the disk containing the names of the stored files. You can display the directory to see if it is available. this disk required file.

Each file stores a separate information object: a document, an article, a numeric array, a program, etc. The information contained in the file becomes active, i.e., can be processed by a computer, only after it is loaded into RAM.

Any user who works on a computer has to deal with files. Even in order to play a computer game, you need to find out in which file its program is stored, be able to find this file and initialize the program.

Working with files on a computer is done using the file system.The file system is a functional part of the OS that allows operations on files.

To find the desired file, the user must know: a) what the file name is; b) where the file is stored.

In almost all operating systems, the file name is composed of two parts separated by a dot. For example: myprog.pas

To the left of the dot is the actual file name (myprog). The part of the name following the dot is called the file extension (pas). Usually Latin letters and numbers are used in file names. On most operating systems, the maximum extension length is 3 characters. In addition, the file name may not have an extension. In the Windows operating system, Russian letters are allowed in file names; maximum name length – 256 characters,except for nine special ones: \ / : * ? “< > |.

You can use spaces and periods in naming. And the file ended with three characters that made up the so-called extension.

File extension – a chaotic sequence of characters added to the end.

File type

Extension

Executable programs

exe, com

Text files

txt, rtf,doc

Graphic files

bmp, gif, jpg, png, pds

Web pages

htm, html

Sound files

wav, mp3, midi, kar, ogg

Video files

avi, mpeg

Program code (text) in programming languages

bas, pas, cpp

The extension indicates what kind of information is stored in this file.

The program is initialized by writing it into RAM and the processor starts executing it.

One computer can have several disk drives - disk storage devices. Each drive is given a one-letter name (followed by a colon), for example A:, B:, C:. Often on personal computers, a large capacity disk built into system unit(it's called a hard drive) is divided into sections. Each of these partitions is called a logical disk, and is given the name C:, D:, E:, etc. The names A: and B: usually refer to small-capacity removable disks - floppy disks(floppy disks). They can also be considered as names of disks, only logical ones, each of which completely occupies a real (physical) disk. Therefore, A:, B:, C:, D: are all names of logical drives.

The name of the logical drive containing the file is the first "coordinate" that determines the location of the file.

The entire collection of files on the disk and the relationships between them is called the file structure. Different operating systems may support different file structure organizations.

Types of file structure:

1) Single-level – a sequence of file names, used for disks with a small number of files. A single-level file structure is a simple sequence of files. To find a file on disk, you just need to specify the file name. For example, if the tetris.exe file is located on drive A:, then its “full address” looks like this: A:\tetris.exe

Operating systems with a single-level file structure are used on the simplest educational computers equipped only with floppy disks.

2) Multi-level or hierarchical - a tree structure used to store thousands of files.

The file structure maintenance functions include the following operations (naturally, occurring in the environment of any OS):

    creating files

    creating directories

    deleting files and directories

In the Windows operating system, the term “folder” is used to refer to the concept of “directory”.

A directory can contain many subdirectories, resulting in branched file structures on disks.

Organizing files in a tree structure is calledfile system . The principle of organizing a file system istabular.
That is, information about the location of the file on the disk is stored in the file allocation table.
File Allocation Table, FAT ).

StructureFAT similar to the table of contents of a book - the operating system uses it to quickly find files.

Later FAT32 was introduced - an improved version of FAT. It could support volumes that could already exceed 2 GB (unlike FAT).

Then a more promising direction in the development of file systems appeared -NTFS ( New Technology File System - file system new technology), supporting long names files and offering a reliable data security system.

The size of an NTFS partition is not limited. Also, NTFS saves disk space by compressing the disk itself, individual files and directories.

Windows XP uses both FAT32 and NTFS.

A graphical representation of a hierarchical file structure is called a tree.

In Fig. 2.9 directory names are written in capital letters, and file names are written in lowercase letters. Here in the root directory there are two folders: IVANOV and PETROV and one file fin.com. The IVANOV folder contains two subfolders PROGS and DATA. The DATA folder is empty; there are three files in the PROGS folder, etc. In a tree, the root directory is usually represented by the symbol \.

Now imagine that you need to find a specific document. To do this, you need to know the box in which it is located, as well as the “path” to the document inside the box: the entire sequence of folders that need to be opened to get to the papers you are looking for.

The second coordinate that determines the location of the file is the path to the file on disk. The path to a file is a sequence of directory names, starting from the root directory and ending with the one in which the file is directly stored.

Here is the familiar fairy-tale analogy of the concept of “path to file”: “There is a chest hanging on an oak tree, in the chest there is a hare, in the hare there is a duck, in the duck there is an egg, in the egg there is a needle, at the end of which is Koshcheev’s death.”

The logical drive name, file path, and file name written down in sequence form the full file name.

If shown in Fig. 2.9 file structure is stored on the C: drive, then the full names of some of the files included in it in the symbolism of the MS-DOS and Windows operating systems look like this:

C:\fin.com

C:\IVANOV\PROGS\prog1.pas

C:\ PETROV\ DATA\ task. dat

3. Consolidating new material:

1. What is a file system? The file system is a functional part of the OS that allows operations with files.

2. Explain the concept of "file". A file is information stored on external media and united by a common name.

3. What types of file tables are there?FAT, FAT32 and NTFS

4.What is the file extension? The file name consists of the actual name and extension. The extension indicates the type of information in the file (file type).

5. File system functions.

Creating files

Creating directories

Renaming files and directories

Copying, moving files

Removing files and directories

Navigate through the file system (Explorer) to access specific file

Managing file attributes (properties) (hiding, read-only, etc.)

6. What is the disk file structure? The file structure of a disk is a collection of files on the disk and the relationships between them. File structures can be simple or multi-level (hierarchical).

7. What is a directory? A directory is a named collection of files and subdirectories (subdirectories). The top-level directory is called the root directory. It is not nested in any directories.

8. What does the full file name consist of? The full file name consists of the drive name, the path to the file on the drive, and the file name.

4. Practical work. Operations with files and foldersWindows. (Handout).

5. Setting homework: §2.4 , answer the questions at the end of the paragraph.

6. Summing up: Giving marks for the lesson.