8 shows the path to the file. File, name, type, file access path, full file name. The file extension is assigned
The operating system searches for a file in a directory by its full name. This means that in principle there cannot be two different files with the same name in the same directory or subdirectory . We remind you that the name consists of the file name and its extension. It is also not allowed to have two nested subdirectories with the same names in one directory or subdirectory.
Directories or subdirectories are allowed to have files or child subdirectories with the same name. But then, to clearly indicate required file The file name is not enough. In order to distinguish files with the same name, it is also necessary to indicate the subdirectories in which they are located. But in the general case, you need to specify not just one subdirectory, but the entire chain of subdirectories, which must be followed from the root directory to the subdirectory containing the file you are looking for in order to get to the desired file and determine its location.
The chain of names of subdirectories that need to be traversed, starting from the root directory and ending with the subdirectory containing the file, is called byor routeto file.
In MS DOS and Windows operating systems, the root directory in the path is indicated by the \ character. The same symbol separates the names of subdirectories in the chain from each other, as well as the file name from the name of the subdirectory in which it is located. This symbol is called back slash.
Thus, for files located in the root directory (see Figure 3.3), the path is only the root directory designator \, and the files are specified as follows:
The file in the user1 subdirectory has the path \user1:
\user1\picture.bmp.
And the path to files from the kontakti subdirectory must include the names of both subdirectories - \user1\kontakti:
\user1\kontakti\ivanov.doc,
\user1\kontakti\postavki.txt
Paths can be specified not only for files, but also for subdirectories. So, for the kontakti subdirectory the path is \user1.
Since your computer includes several different disk devices, to uniquely identify a file, you must specify which device it is located on. This can be done by specifying the name of the disk device containing the file. The name of the device is usually placed before the path to the file. Full file name (file specification) contains
ü device name,
ü path to the file,
ü file name.
<имя носителя>\<имя каталога-1>\...\<имя каталога-N>\<собственное имя файла>.
If, for example, a directory whose structure is shown in Fig. 3.3 is located on the C: hard drive, then the full specification of the postavki.txt file looks like:
C:\user1\kontakti\postavki.txt
If this directory is located on a floppy disk, that is, on disk device A:, then the specification will be written as follows:
A:\user1\kontakti\postavki.txt
A complete file specification completely and unambiguously identifies the desired file, which is what the operating system requires in order to accurately execute user commands. If the slightest mistake is made in the file specification record, say, at least one character is missing or distorted, operating system will not be able to find such a file.
These characters serve to separate the names of the directories that make up the path to the file.
For example, in the following addressing entry /home/user_kolia/foo/bar.txt, the bar.txt part is the file name, and /home/user_kolia/foo/ is the path to it.
The path can be absolute or relative. Full or absolute path is a path that points to the same location in the file system, regardless of the current working directory or other circumstances. The full path always starts from the root directory. Relative path is a path relative to the user's current working directory or active applications.
To search files efficiently UNIX-like operating systems typically have a $PATH system variable in the shell (such as sh) that specifies redirections to critical executable files. You can find out the value of this variable using the command echo $PATH or similar.
Path representations by operating system and shell
operating system | Shell | Root directory | Directory separator | Parent directory | Examples |
---|---|---|---|---|---|
UNIX-like OS | UNIX command shell | / | / | .. | /home/user/docs/Letter.txt |
DOS | COMMAND.COM | [drive letter:]\ or \\[server name]\ |
/ or \ (note: command.com does not treat / as a directory separator) | .. | C:\USER\DOCS\LETTER.TXT A:PICTURE.JPG \\SERVER01\USER\DOCS\LETTER.TXT |
OS/2 | cmd.exe | [drive letter:]\ | / or \ | .. | C:\user\docs\Letter.txt A name that follows the Universal Naming Convention, a fully qualified name for a network resource that includes the server name and the name of a shared resource (printer, directory, or file); for directories or files may also include relative path. Syntax UNC-the path to the printer is as follows: \\Server\NetworkPrinter, where Server is the network name of the computer, NetworkPrinter is the network name of the shared printer on this computer. Syntax UNC-the path to the directory or file is as follows: \\Server\NetworkDirectory[\RelativePath] , where Server is the network name of the computer, NetworkDirectory is the network name of the shared directory on this computer, and RelativePath is the path to the directory or file from the shared directory. The Network Directory is not necessarily named the same as the directory associated with it on the server; the name is given during opening public access to a directory on the computer's file system. In versions Windows, preceding Windows XP, only API-calls using Long UNC, could use paths longer than 260 characters. Total in Microsoft Windows The following path types are used:
LiteratureMitch Tulloch, Ingrid Tulloch Microsoft Encyclopedia of Networking, Second Edition. - ISBN 0-7356-1378-8 NotesWikimedia Foundation. 2010.
See what “Path to file” is in other dictionaries:Autorun.inf- Autorun.inf file used for automatic start or installation of applications and programs on storage media in the operating environment Microsoft systems Windows (since Windows versions 95). This file should be located in the root... ... Wikipedia File name- Displaying the contents of the C:/temp directory and the names of the files in it using the dir command in the Windows command interpreter File name is a string of characters that uniquely identifies a file in a certain namespace ... Wikipedia EncFS- Type file system, encryption Developer Valient Gough Operating Linux system, FreeBSD, Mac OS Latest version 1.7.4 (September 5, 2010) License G ... Wikipedia SSI (programming)- This term has other meanings, see SSI. SSI (Server Side Includes) is a simple language for dynamically “assembling” web pages on the server from individual components and issuing the resulting HTML to the client... ... Wikipedia Server Side Include (programming) Server Side Include- SSI (Server Side Includes) is a simple language for dynamically “assembling” web pages on the server from individual components and issuing the resulting Apache web server to the client using the mod include module. Included in... ... Wikipedia |
Now let's talk about the file path. Let's assume that on drive C: we have a directory APRIL, and in it there is a file REPORT.TXT. The full path to the file includes the drive letter, a list of all subdirectories and the file name itself with extension. Path elements are separated by backslashes. In our case, the path to the file will look like this:
C:/APRIIAREPORT.TXT
If there is a TXT subdirectory in the APRIL subdirectory, and there is an INFO.DOC file in it, then the path will be as follows:
C:/APRILTXTINFO.DOC
Consider the file name. It consists of the name itself and the extension. The extension is used to determine the file type. The extension.TXT is usually used for text files. The system, when opening a file of a certain type, will launch the program associated with that file type and pass it the file to open. For example, if you open the REPORT.TXT file, the system will launch the Notepad program (since by default Notepad is associated with text files) and will load our file into it.
Previously, the file name could be eight characters (or less) and the extension three (or less). The extension was considered to be the part of the file name after the dot. Now the situation has changed. The full file name (including path and extension) can be up to 260 characters long. It is clear that the longest file names can only be found in the root directory - 257 characters including the extension. Such files can no longer be copied to other subdirectories, since the limit will be exceeded maximum length file name.
Now let's talk about expansion. Now the extension can consist of an arbitrary number of characters, the main thing is that the maximum file length is not exceeded. Typically, extensions of 1-5 characters are used. Now the extension is the part of the file name after the last dot. This is because previously the file name could not contain a dot, now there can be more than one dot. Here's an example:
Long file name.Path to file.Working with files.doc
In our case, the file extension is .doc - part of the name after the last dot. There are three points in total.
The following characters cannot be used in file and directory (folder) names: / ? : * " >< |
The first character is used to separate path elements, the second is used to separate network path elements when a forward slash is used rather than a backslash. The colon is reserved to indicate the drive letter. Symbols? and * are used in file masks (now I’ll explain what they are). Quotes are used to specify file names that contain spaces, for example:
"C:/Program Files/Microsoft/ProgramFile.dll"
Symbols<, >, | used in I/O redirection to command line. You don't need to know what this is, although we'll cover the basic commands for working with files and directories on the command line in this chapter.
What is a file mask? A file mask allows you to select a group of files. In this case, the symbols * are used (replaces an arbitrary number of characters) and? (replaces one specific character). Now let's figure out how masks work.
Let's assume we have the following files in our directory:
G1.doc
G2.doc
G22.doc
G234.doc
The *.doc mask will select all files, since all files have a .doc extension. The mask G7.doc (or G?.*) will select only the first two files, since they begin with the letter G, but the mask specifies that the name must contain only two characters: the first is G, and the second is an arbitrary one (this is what the character replaces ?).
If you need to select all files that begin with the letter G, but the length of the file and its extension do not matter, you can use the G* mask. The mask G*.TXT selects all files that begin with the letter G and have the extension .TXT. But we don’t have such files, so nothing will be highlighted.
The characters * and ? can be used in any part of the mask. For example, mask *.? will select all files whose extension consists of any one character. And the mask???.* will select files whose name contains three characters and whose extension is any.
I think the principle is clear. File masks are convenient to use when searching for files, as will be shown below.
Route (path) to the file. Full file name. File attributes (in a broad sense).
To uniquely determine the address of a file on a computer, you need to know:
Path to the folder where the file is located (analogous to the address of a person’s apartment);
The name of the file in this folder (analogous to the person’s full name).
The file name is necessary so that it (by name) can be used to access a file on disk. There cannot be two files with the same names in one folder; this is acceptable in different folders.
Full file name(full path to file) in Windows systems consists of a drive letter, followed by a colon and a slash (backslash), then subdirectories are listed through backslashes, and the file name is written at the end. The string is terminated with a NULL character. Example:
C:WindowsSystem32calc. exe
on *nix systems, the full path consists of a slash (/), indicating the root directory, followed by subdirectories separated by slashes, and the file name is written at the end. Example:
/usr/local/bin/gcc
The file name consists of two parts separated by a dot:
Name (before the dot, often also called the name);
Extension(optional part).
The full file name (including extension) in Windows can be up to 260 characters, given value defined by the MAX_PATH constant in the Windows API; for example, the maximum allowed full file name on drive C would be “C:<256 символов>NULL". However, Unicode versions of some functions allow file names of up to 32,000 characters, such names begin with the prefix "?". Example:
C:WindowsSystem32calc. exe
When using the prefix "?" You must specify an absolute path to the file; relative paths are not allowed. When using relative paths, the maximum fully qualified file name is limited by the MAX_PATH constant (260 characters).
The use of some service characters in the file name is prohibited: "", "/", ":" (only in Windows - in Linux this character is allowed in the name), "*", "?", """, "<», «>», «|».
The name of the file (before the dot) should be given a meaningful name, indicating the purpose of the file, in order to avoid confusion in the future.
File extension
File extension may be absent altogether or be of any length (within the length of the file name). The extension determines the type (format) of the file, that is, by the extension, the user and the OS determine the type of data stored in the file. For example, on Windows, files with the extension bmp- uncompressed images, jpg- compressed images.
All files on a computer can be divided into:
programs (executable files);
documents.
Only programs can “do” something: create (documents), view (documents), change (documents). A document is the result of the program, saved to disk. Documents can't do anything, they're just data on disk. To view or edit a document, you must have a program installed that can work with this type of document. If such a program is not installed, the OS will not be able to open the file.
For example, in Windows OS extensions are used for programs exe And com. Files with other extensions can be considered documents.
lesson topic"File and File System"
item"Informatics and ICT"
class/group 8th grade
used sources and literature
Computer Science and ICT. Grades 8-11: methodological manual / N.D. Ugrinovich.-M.: BINOM, 2010
Informatics and ICT: textbook for grade 8 / N.D. Ugrinovich - 4th ed. - M.: BINOM. Knowledge Laboratory, 2011
keywords or supporting concepts separated by commas (at least 5 pieces) computer science, test, computer, file system, working with files.
Option 1
1.The file is:
2.The file name consists of two parts:
B) name and extension
3.The file name is:
A) operating system
B) processor
D) user
4. The extension is assigned to the file:
B) processor
B) user
D) operating system
5.The file name can include up to
A) 16 characters
B)254 characters
B) 256 characters
D) 255 characters
6. Allotted for expansion
A) 4 characters
B) 2 characters
B) 3 characters
D) 5 characters
7.In order for files to be stored on the disk, the disk must first be:
A) copied
B) formatted
B) deleted
D) difragmented
8.During the formatting process, the disk is divided into two areas :
A) name and extension
B) RAM and cache memory
D) sectors and tracks
9.Single-level file system
10.Path to file
D) starts with the logical name of the disk, then writes down a sequence of names of folders nested inside each other, the last of which contains the desired file
A) 3: LIST. EXE
B ) IN3:.TXT
IN )12345.BMP
G ) SPRAVKI
A) to shell programs
D) applications
B) about the volume of the disk
B) about the contents of the file
14.Where is the work in progress stored? at the moment program and processed data
A) in external memory
B) in the processor
B) in RAM
D) on the output device
15.A directory is a place on a disk named and containing
B) files and other directories
B) only certain files
A) keys ALT+ DEL
B) keys CTRL+ DEL
B) when you turn on the computer
D) key DEL
17. The operating system is:
A) in numbers
B) letters and numbers
B) in Russian letters
D) in Latin letters
19.The root directory is
A) first top
B) the lowest
B) the most important
D) the biggest
20.The file path does not include...
A) disk name
B) directory name
B) team
G) :
21.The state of the operating system in which it stops producing results and responding to requests. - This ..
A) turning off the printer
B) looping
B) turning off the monitor
D) freezing
Doc 3.
DOC3
Doc1
TOM3
Doc3
A ) A:\DOC3
B ) A:\DOC3\Doc3
IN ) A:\DOC3\Doc1
G ) A:\TOM3\Doc3
24.The application is
25.The application operates under control
A) RAM
B) processor
B) operating system
D) user
26. Applications general purpose do not include:
B) sound editors
G) text editors
Test on the topics “Files and file system”,
"Computer Software"
Option 2
1.The file name consists of two parts:
A) addresses of the first sector and file size
B) name and extension
C) file and directory storage areas
D) name and address of the first sector
2.The application operates under control
A) RAM
B) processor
B) operating system
D) user
3. The extension is assigned to the file:
A) the program when it was created
B) processor
B) user
D) operating system
4.The file name can include up to
A) 16 characters
B)254 characters
B) 256 characters
D) 255 characters
5.In order for files to be stored on the disk, the disk must first be:
A) copied
B) formatted
B) deleted
D) difragmented
6.The root directory is
A) first top
B) the lowest
B) the most important
D) the biggest
7.Single-level file system
A) a disk directory is a hierarchical sequence of file names
B) is a system of nested folders
IN) when the disk directory is a linear sequence of file names and corresponding initial sectors
G) a disk directory is a geometric sequence of file names
8.The file is:
A) disk storage area
B) program or data stored in long-term memory
C) a program or data that has a name and is stored in RAM
G) a program or data that has a name and is stored in long-term memory
9.Path to file
A) starts with the logical name of the disk, then the desired file is written, then a sequence of names of folders nested inside each other
B) begins with a sequence of names of folders nested within each other, the last of which contains the desired file, then the logical name of the disk is written,
B) starts with the last folder in which the desired file is located, then writes the logical name of the drive
G) starts with the logical name of the drive, then writes down a sequence of names of folders nested inside each other, the last of which contains the desired file
10. Allotted for expansion
A) 4 characters
B) 2 characters
B) 3 characters
D) 5 characters
11.Choose the correct file name
A ) 3:LIST.EXE
B ) IN3:.TXT
B)12345. BMP
G) SPRAVKI
12.Operating system refers to
A) to shell programs
B) to the systemic software
B) to application software
D) applications
13.To organize access to files, the operating system must have information about
A) about the cluster numbers where each file is located
B) about the volume of the disk
B) about the contents of the file
D) about the number of files on the disk
14.During the formatting process, the disk is divided into two areas :
A) name and extension
B) storage area and directory
B) RAM and cache memory
D) sectors and tracks
15.Where the currently running program and processed data are stored
A) in external memory
B) in the processor
B) in RAM
A) keys ALT+ DEL
B) keys CTRL+ DEL
B) when you turn on the computer
D) key DEL
17. The operating system is:
A) computer technical documentation
B) a set of devices and programs for general use
C) a set of basic computer devices
D) a set of programs that organize the control of the computer and its interaction with the user
18.The name of the logical drive is indicated
A) in numbers
B) letters and numbers
B) in Russian letters
D) in Latin letters
19.The file path does not include...
A) disk name
B) directory name
B) team
G) :
20.The state of the operating system in which it stops producing results and responding to requests. - This ..
A) turning off the printer
B) looping
B) turning off the monitor
D) freezing
21.The file name is:
A) operating system
B) processor
C) the program when it was created
D) user
22.Given a directory tree. Specify the full filename Doc 3.
DOC3
Doc1
TOM3
Doc3
A ) A:\DOC3
B ) A:\DOC3\Doc3
IN ) A:\DOC3\Doc1
G ) A:\TOM3\Doc3
23.During the loading process of the operating system, the following occurs:
A) copying operating system files from a floppy disk to hard drive
B) copying operating system files from
D) copying the contents of RAM to the hard drive.
24. A directory is a place on a disk named and containing
A) List of programs compiled by the user
B) files and other directories
B) only certain files
D) information about files (name, extension, date last update)
25.The application is
A) a user who solves his application problems
B) a program with which the operating system solves its application problems
C) devices with which the user solves his application problems
D) a program with which the user solves his applied problems
26.General purpose applications do not include:
A) graphic editors
B) custom editors
B) sound editors
D) text editors
Key
Option 1
Option2