The operating system distinguishes file types based on what is in the file
The operating system distinguishes file types based on the "extension" of the file; the file extension is a mechanism used by the operating system to mark the file type. The more important role of the extension is to let the system decide which file type to use. Which software should the user use to open this file?
The operating environment of this tutorial: Windows 10 system, DELL G3 computer.
The operating system distinguishes file types based on what the file is
The operating system distinguishes file types based on the "extension" of the file
A mechanism used by the operating system to mark file types
The file extension (Filename Extension, or extended file name, suffix name) is an early operating system (such as VMS/CP/ M/DOS, etc.) is a mechanism used to mark file formats.
In a file name like "example.txt", example is the file main name, txt is the file extension, indicating that the file is a plain text file, and the period "." is the file main name and file extension. Name delimiter.
The more important role of the file extension is to let the system decide which software to use when the user wants to open the file.
Main purpose introduction
Protection is important File
For some files (such as DOC, etc.), we do not want others to open them at will. The simplest protection method is to change its extension to another name, such as changing the ".xls" extension to ".cqq", etc. In this way, when you double-click the ".cqq" file, it cannot be opened directly, allowing Others mistakenly thought it was a document of unknown origin and gave up their interest in it. When we run it, we only need to adjust the association status to open it smoothly. For example, you can use Notepad to edit a batch file whose contents include the lines "assoc .xls= Excel.Sheet.8" "ping 127.0.1 –n 10" "assoc .xls=cqq". Then save it as an "open.bat" file. The batch process is simple. The first line uses the "assoc" command to set the correct association for the ".XLS" file. If you want to view the association of files of a specified type, you can execute the "assoc .xxx" command in the CMD window, where "xxx" represents the specific file extension.
The second line uses the Ping command to detect the local IP. The "-n" parameter specifies the number of detections. Generally speaking, one detection takes about 1 second. It takes 10 seconds to detect 10 times here. Of course, you can It depends on the actual situation. Note that "127.0.1" here also represents the local address, which is equivalent to "127.0.0.1". The third line re-associates the ".xls" type to our custom type. First modify the extension of the file that needs to be protected, for example, rename "wendang.xls" to "wendang.cqq". In this way, others cannot open it directly. When we need to use it, we can run the "open.bat" file and double-click the "wendang.cqq" file within the specified time interval to open it smoothly. The batch process will then automatically modify the file association status to prevent others from manipulating the file at will.
Of course, for security reasons, it is best to create a new account in the system (such as "gly", etc.) and set a complex password for it. Store the batch file in the NTFS partition, click the "Add" button in the "Security" panel in its properties window, add the "gly" account, and click the "Delete" button to delete the "Group or User Name" other groups and accounts in the column. If some accounts cannot be deleted, you can click the "Advanced" button, cancel "Inherit from parent those permission items that can be applied to child objects" in the "Permissions" panel in the pop-up window, and click the "Delete" button in the pop-up dialog box , you can clear all accounts. Select the "gly" account and check the "Full Control" item in the permission list, so that only the "gyl" account can operate the batch file.
For general extensions, we can clearly know the file type, but for uncommon extensions or files without extensions, it is not that simple to identify their true identity. Using the small tool FileTypeID, the problem can be easily solved. FileTypeID can identify thousands of file types. Run the program, drag and drop files of unknown types directly into the main interface of the program, and click the "Details" button to display the detailed information of the file, as shown in Figure 1. Click the "Analyze" button, and the file type to which the file may belong is displayed in the "Extension" column in the identification list, the probability of matching the file type is displayed in the "Match" column, and the file type is displayed in the "Type" column. Type description information. Based on this information, it is not difficult to discover its true identity.
In addition, when encountering files of unknown types, you can also use search engines such as Baidu to find the corresponding information. In Windows 8, the processing method is much simpler. After double-clicking a file of unknown type, click "More Options" in the pop-up panel to display all programs in the system that can process the file. After selecting the target program, check the item "Open all XXX files with this application", then you can use the program to open the file. Otherwise, you can click the "Find the application in the App Store" item, which can be easily found in the App Store. Quickly find the application corresponding to the file format, select the corresponding application item, view its description information, and if appropriate, download and install the application. [2]
Generally speaking, no matter what type of file, a specific identifier will be displayed at the beginning of it. For example, for EXE files, the identifier is "MZ". Use tools such as Notepad or WinHex to open the target file, find the identification information at the beginning of it, and then search online to learn the specific file type. In addition, using the software "Translate Extension", you can easily identify the actual file type. Enter the file extension in the upper right corner of its main interface and click the query button to quickly find the relevant description information and learn about its actual type. "Translate Extension" supports 6113 file types. For some special file types, if they cannot be recognized, you can click the "Submit" button to send them to the author for screening.
Save disk space
You can search for all .scr files in the system (type *.scr and then search), and delete unnecessary .scr files in the search results window files to save disk space. If you want to start the screen saver immediately, right-click on any of the .scr files and drag it to the desktop or the Start menu (or one of its submenus) and select "CreateShortcut". Then click this Shocrtut to start the screen saver.
Clear icons on the control panel
Sometimes these unwanted icons are not carried by the Windows system control panel itself, but by some other programs without permission installed. In this case, it is necessary for the reader to understand that the file extension of most control panel icons is .cpI. Type *.cpI in the Windows system search function to list applications related to the control panel in the system. Then double-click each listed file and filter out unnecessary files. Move these unwanted files to another folder or make a backup, and delete the original icon files. It is worth noting that sometimes multiple icons in the control panel may only represent one .cpl file. For example, if the main·cpl file is deleted, the keyboard, mouse, and printer icons will be deleted.
Setting Association
In Windows Control Panel-Default Programs-Setting Association, you can find almost all file types of this Windows. You can find the name, description and Associated program (current default).
For more related knowledge, please visit the FAQ column!
The above is the detailed content of The operating system distinguishes file types based on what is in the file. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



H5. The main difference between mini programs and APP is: technical architecture: H5 is based on web technology, and mini programs and APP are independent applications. Experience and functions: H5 is light and easy to use, with limited functions; mini programs are lightweight and have good interactiveness; APPs are powerful and have smooth experience. Compatibility: H5 is cross-platform compatible, applets and APPs are restricted by the platform. Development cost: H5 has low development cost, medium mini programs, and highest APP. Applicable scenarios: H5 is suitable for information display, applets are suitable for lightweight applications, and APPs are suitable for complex functions.

Yes, MySQL can be installed on Windows 7, and although Microsoft has stopped supporting Windows 7, MySQL is still compatible with it. However, the following points should be noted during the installation process: Download the MySQL installer for Windows. Select the appropriate version of MySQL (community or enterprise). Select the appropriate installation directory and character set during the installation process. Set the root user password and keep it properly. Connect to the database for testing. Note the compatibility and security issues on Windows 7, and it is recommended to upgrade to a supported operating system.

MySQL and MariaDB can coexist, but need to be configured with caution. The key is to allocate different port numbers and data directories to each database, and adjust parameters such as memory allocation and cache size. Connection pooling, application configuration, and version differences also need to be considered and need to be carefully tested and planned to avoid pitfalls. Running two databases simultaneously can cause performance problems in situations where resources are limited.

The impact of Rust language proficiency on desktop program development under the Tauri framework Tauri is a desktop application development framework built using Rust, thanks to its lightweight and...

The main reasons why you cannot log in to MySQL as root are permission problems, configuration file errors, password inconsistent, socket file problems, or firewall interception. The solution includes: check whether the bind-address parameter in the configuration file is configured correctly. Check whether the root user permissions have been modified or deleted and reset. Verify that the password is accurate, including case and special characters. Check socket file permission settings and paths. Check that the firewall blocks connections to the MySQL server.

How to use locally installed font files on web pages Have you encountered this situation in web page development: you have installed a font on your computer...

How to use JavaScript or CSS to control the top and end of the page in the browser's printing settings. In the browser's printing settings, there is an option to control whether the display is...

C language conditional compilation is a mechanism for selectively compiling code blocks based on compile-time conditions. The introductory methods include: using #if and #else directives to select code blocks based on conditions. Commonly used conditional expressions include STDC, _WIN32 and linux. Practical case: Print different messages according to the operating system. Use different data types according to the number of digits of the system. Different header files are supported according to the compiler. Conditional compilation enhances the portability and flexibility of the code, making it adaptable to compiler, operating system, and CPU architecture changes.