Computers Windows Internet

Types of file attributes. The files on the flash drive have disappeared. How to change the context menu for files of a certain type

The terminology for non * nix-compatible systems (DOS, OS / 2, Windows) is described below. The family of "nix" operating systems and their ways of storing files are different and require separate consideration.

File attributes are special labels that allow the file system to identify actions that can be performed on them. The appearance of such attributes was caused by the need to improve fault tolerance file system... Since the information in the file system is stored sequentially, there must be signs by which it will be possible to distinguish a file from a directory, system folder from backup.

Files on the flash drive disappeared

Two-level directories contain information about the user directories in the main directory. Naturally, the expansion of two-level directories is tree-level directories. The root directory is the root of the tree. Custom directories can have their own directory hierarchy and logically group their files into them. Drawing. The user's position in the directory structure is called the current directory. User identification acc. its directory name and file name form the full path to the file.

We also call absolute pathname. An absolute path is determined by the name of the file associated with the names of all subdirectories that lie in the path from the root directory to this file. Similarly, there is a relative path, which is given by a name associated with the names of all subdirectories that lie in the path from the current directory to this file. This usually happens by adding special directory names for the current directory and the predecessor to the directory.

At a low level, this is implemented by special methods (marking) of the initial and final clusters of the storage device. But only low-level programs, such as the operating system, have access to such addressing. For this marking, special marks have been added, allowing you to change the file attributes.

By generalizing the tree structure of directories to an acyclic one, we can achieve that one file can lead to multiple access paths. If the directory structure can be a general schedule, the same sequences can be repeated in the access paths. Exists different approaches to multiple drives.

  • Separate file systems on separate disks.
  • Mount file systems.
  • The root directory is on one disk.
  • In a directory hierarchical directory, the entire disk is mapped to a directory.
In older operating systems, there were significant restrictions on file names: short names, case insensitive, the set of characters that can form a file name is significantly limited. In filenames, development refers to long names.

There are a small number of them, since they originally appeared in old operating and file systems, and their support by modern operating systems is a necessity for compatibility.

File attributes are as follows:

Read only. Indicates that the file is not writeable and is readable. If it is present, the OS does not allow making changes to the file. The attribute is relevant for storing constant information or data with limited access.

Older versions of the files are supported on most operating systems. You can use name or name and generation to refer to the file. On some operating systems, the generation files are part of the system, and some are programmatically addressable.

Typically, the operating system supports Additional information about the file. Last modified, last accessed. ... For many operating systems, there is more information about files that determine, for example, which application processes the file.

On some systems, files are divided into a piece of data and a piece of a resource. These operating systems usually allow you to change the resource of a program section without the need for translation new program... When writing to a file, all or part of the file is locked, and other processes or users cannot modify the contents of the affected area during the lockout period. It is used, for example, to access databases.

System. System file or directory. Serves for an increased degree of protection of system information about data and equipment. An object with this attribute is much more difficult to modify or delete. In some cases, the OS completely blocks access to such files - only the kernel can use them

Archive. Signals that changes have been made to the file. This attribute is critical for With a large amount of backed up information, the update of archives is significantly accelerated if you copy only changed data - objects that have file attributes - archive.

Distribution methods are specified by direct access to the disk. There are three main distribution methods. Each file occupies a contiguous set of blocks on disk. The file address is then specified only at the address of the first block. The rest of the blocks stick together and create contiguous disk space.

Graphic information input devices

The advantage of contiguous distribution is the low likelihood of movement of the disk head, and the main disadvantage is the need for constant free space for a file and a complex implementation of dynamic file size changes. Sequential distribution is a simple technique that determines the starting base and length, that is, the number of blocks. Here you can implement sequential and direct access to data.

Hidden - Most often used in conjunction with the system attribute. This attribute makes the file invisible when viewing the contents of the directory.

An ordinary user does not use when working with files. Only a few points can be considered an exception:

    If on removable media or the hard drive, files and folders have suddenly "disappeared". This happens very often when a computer becomes infected with a certain type of viruses that change the file attributes to "system" and "hidden". Don't panic, the problem is trivial. You can change file attributes through the file's Properties dialog box or using any explorer program (except Microsoft Explorer). Also, if it is possible to access, you can view and change the file attributes using the ATTRIB system command. By running it with the "/?" you can see a list of possible actions with files.

    This spatial inconsistency depends on how efficiently free space is sought when disk space is allocated dynamically. If there is no contiguous storage space on disk, it is necessary to reorganize the data blocks in the form of defragmentation, which is time-consuming.

    For these reasons, files cannot grow and have their original dimension when the disk file is loaded. Tied distribution eliminates disadvantages continuous distribution by linking the blocks used for the file. The file is then a linked list of disk blocks, and the blocks can be scattered around the disk at random.

    The opposite situation is that there are a number of files that need to be restricted, prevented from being modified or deleted. Then changing the file attributes will allow you to cope with this task.

    Setting the "archived" attribute allows you to efficiently make up-to-date backups when several users are working on one project. Project consolidation systems can be configured to provide latest versions data of all users with remote access.

    As a rule, empty allocation blocks are not allocated, and no reserve is created. Most allocation strategies focus on allocating neighboring allocation blocks. The length of the distribution block is determined by the parameters operating system and disk capacity. The shorter the selection box, the more selection boxes. The short selection block generates file fragmentation and frequent allocation of non-adjacent selection blocks.

    A long allocation block reduces file fragmentation, but there is a risk of so-called internal fragmentation, i.e. do not use full selection of the selected selection block. Allocating indexes alters the poor direct access of the associated method by putting block indexes of individual files together. The allocated file allocators are grouped into a common block, in the index table, where the index blocks can be ordered hierarchically.

At present, with the advent of modern file systems, increased requirements for protection and the speed of information processing, file attributes are no longer so in demand. They were replaced by complex add-ons with indexes, caching and parallel access.

File management

The required table is created, the so-called index block. This method is suitable for direct and dynamic access without external fragmentation. However, some spatial overhead is required for the index block. When the file is opened, the index is loaded into memory to enable the index hierarchy.

To efficiently manage free memory, a bitmap with one bit corresponding to one block on disk is used. it linear transformation bit position to block position. Bitmap requires implementation on a separate disk.

Access is referring to a file in order to read or write information to it. The file system supports two types of file access:

Ø sequential access method;

Ø direct (direct) access method.

With sequential access, records from a file are read in a row, strictly in the order of their location in the file. Therefore, in order to refer to (access) a specific record, it is necessary to read all the previous ones. At direct access provides direct access to the record by its number in the file. The mechanism for accessing a file and its records during programming also has two options:

How does the operating system know which program to use to open the document?

Which is a negligible percentage of the total disk capacity. It should be noted that the map must be permanently saved to disk, but it is modified in operating memory so that the copy cannot consistently match the original. In the index method, free memory management can also be performed by chaining free physical pages due to the difficulty of finding contiguous disk space.

  • What information does the operating system support in files?
  • What are the organizations of the directory structure?
  • What are the file access methods?
  • Think about buffering while saving and reading files to disk.
In this chapter, you are familiar with the principles of the operating system file system. This chapter has focused on understanding how to save files to disk.

Access to the file using a special table - the manager
file block;

· Access to the file by identifier.

Control block file (FCB - File Control Block) contains the following information:

· Number (letter) of the drive where the disc with the file is installed;

· File name and extension;

· Current block number in the file;

How can I find out what rights have been set for a file?

He can establish the law at his discretion. He has a lot of accounts. You can connect to your computer remotely or locally. Accounts can also be provided remotely. As you can see, the freedom of use is not for play here. In the system, there is a separation of the owner of the file, the group assigned to the file, and other users. When you enter this command, information about my example file is displayed. The first information on the left is the access right, the second is the number of relationships, the third is for the user, and the fourth is on the right.

· Record length in bytes;

· File size in bytes;

· Date of the last modification of the file;

· Relative record number (current number);

· Record number, etc.

Some of the above parameters require further explanation. The file consists of blocks containing 128 records each. The relative record number is the sequence number of the record in the block. The current block number and relative record number are used when sequentially accessing the records in the file. The record number is a parameter that combines the block number and the relative record number in the block, it is used when random access to the file records. Important parameter- record length (more precisely, the length of a logical, apparent record, which may differ from the length of a physical record due to the presence of various service elements in the record and file structure). The record length is used to determine the number of bytes sent when exchanging information with RAM and when determining the position of the record within a block. The FCB block only allows access to files in the current directory. The file identifier is an ASCIIZ string that identifies the file. ASCIIZ- (ASCII-Zero) string contains the following information:

How to interpret access rights information?

At the end, we see the date and time of the modification and the name of the file. The first character always indicates the file type. As you can see, this is a thinker. Take a look at the table below. In this case, my object is a regular file. Myth does not mean any law. These 9 characters represent 3 rights in a row for each of the three users.

On the left, the first 3 characters are for the owner of the file, as well as 3 characters for the group assigned to this object, and the last 3 for other users. A directory or file is owned by the user who created the file or to whom it is assigned. A group is a specific group of users.

· Number (logical name) of the drive and path to the file (if necessary);

· File name and extension;

· Zero byte (zero-byte).

File attributes

An attribute is a sign that classifies a file, which determines how it is used, access rights to it, etc. DOS allows the following elements to be specified in an attribute:

R (Read only) - the file is read-only and can neither be deleted nor changed. When an attempt is made to update or destroy such a file by system means (using DOS programs), an error message will be displayed. The attribute is set to protect against accidental modification or destruction;

How do I provide a user or group with a file?

So the interpretation is as follows. "The file is a regular file, the owner has the right to read and write, read only, the rest is read only." By default, the file is assigned to the user who created it. You can insert a period instead of a colon. As a group, you can specify a group name or a numeric identifier. There is no space between user and colon, colon and group!

Granting rights to owner, group and others

Granting and changing access rights for a user or group can be done in several ways.

The first method is with letters and symbols

This method sets the permissions parameters for the same file for everyone - that is, we can set the same permissions for everyone or for the owner, group or other users.

H (Hidden) - hidden file. Ignored by many DOS commands. When browsing the directory with the DIR command, information about hidden file usually not issued;

(System) is a system file. System files are intended for the operation of the operating system or the operation of external PC devices;

A (Archive) - not yet archived file. This attribute allows you to determine whether a backup file (creating a backup copy in a special format). Attribute A is assigned to each newly created file and is discarded (destroyed) when the file is backed up.

We indicate who should get these rights

Thanks to this, we can grant each user access to the file with the specified name. Explain the syntax for this command.

We specify the value of the command

The second method is using octal numbers. The octal system uses numbers from 0 to 7.

Thus, we set different rights for all users. Of course, in the case of directories, the value changes accordingly. The fourth digit can be set. This would mean that read permissions will not be granted as standard. Usually the mask is set to 022. As you can see, 0 sets write and read.

Any of the listed attributes or none of them can be assigned to a file at the same time.

The group of file attributes can conditionally include a password that provides access control to files.