CN1098498C - How to Backup and Restore Files with Long File Names on Your Computer - Google Patents

How to Backup and Restore Files with Long File Names on Your Computer Download PDF

Info

Publication number
CN1098498C
CN1098498C CN 99102485 CN99102485A CN1098498C CN 1098498 C CN1098498 C CN 1098498C CN 99102485 CN99102485 CN 99102485 CN 99102485 A CN99102485 A CN 99102485A CN 1098498 C CN1098498 C CN 1098498C
Authority
CN
China
Prior art keywords
file
long
file name
directory
backup
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN 99102485
Other languages
Chinese (zh)
Other versions
CN1266234A (en
Inventor
林光信
陈玄同
刘军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inventec Corp
Original Assignee
Inventec Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inventec Corp filed Critical Inventec Corp
Priority to CN 99102485 priority Critical patent/CN1098498C/en
Publication of CN1266234A publication Critical patent/CN1266234A/en
Application granted granted Critical
Publication of CN1098498C publication Critical patent/CN1098498C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A method for backing up and recovering long filenames of files in a computer comprises the steps of calling a computer input/output system, obtaining a file directory table from a partition area of a logic hard disk, and correspondingly dumping long filenames and short filenames in the file directory table into backup files with long filenames to complete backup operation; then, in the environment without supporting the long filename, the short filename in each directory and subdirectory is searched by the reverse process of preparing the long filename, then the corresponding long filename in the backup file is written back to the original file directory table, and the limitation that the DOS does not support the long filename is bypassed, thereby realizing the purpose of backup and recovery of the long filename.

Description

在电脑中备份和恢复文件的长文件名的方法How to Backup and Restore Files with Long File Names on Your Computer

本发明涉及一种在电脑中备份和恢复文件的长文件名的方法,特别是涉及一种应用于个人电脑中,可以在不支援长文件名的环境下(如DOS环境),备份和恢复长文件名的方法。The invention relates to a method for backing up and restoring long filenames of files in a computer, in particular to a method for backing up and restoring long filenames in an environment that does not support long filenames (such as a DOS environment) when applied to a personal computer. method for the filename.

在微软公司所发表的视窗95(Windows 95)及其后续的视窗电脑操作系统(Windows9x)中,对用户很有用的改进之一就是可以使用长文件名的功能,这使用户从文件名称只能使用8个字元加以命名的限制中解脱了出来。但是,在此之前的电脑操作系统(如Win31,DOS等)并不支援长文件名的文件,为了与DOS相容,视窗95操作系统将每个长文件名都生成一个相应的短文件名,以便在非视窗95(即是不支援长文件名的环境)中也可以通过短文件名而存取文件内容。但是即使视窗95本身挂附有DOS7.0版的操作系统,如果不启动视窗95仍然无法生成长文件名。所以在不支援长文件名的DOS环境下生成长文件名,在许多情况下是非常必要的,例如对电脑操作系统的备份和恢复。In Windows 95 (Windows 95) and its subsequent Windows computer operating system (Windows 9x) published by Microsoft Corporation, one of the improvements that is very useful to users is the ability to use long file names, which allows users to choose from file names. Freed from the limitation of using 8 characters for naming. However, previous computer operating systems (such as Win31, DOS, etc.) do not support files with long file names. In order to be compatible with DOS, the Windows 95 operating system generates a corresponding short file name for each long file name. So that in non-Windows 95 (that is, an environment that does not support long file names), the file content can also be accessed through the short file name. But even if Windows 95 itself is attached with the operating system of DOS7.0 version, if Windows 95 is not started, it still cannot generate long file names. Therefore, it is very necessary to generate long file names in the DOS environment that does not support long file names, such as backup and recovery of computer operating systems.

而在实际使用电脑的过程中,难免遭遇到操作系统破坏的情形,而重新安装操作系统对于使用视窗95的用户而言,往往是一件复杂却又不得不去面对的过程,如果用户没有备份,就必需通过重新安装的方式重新安装置应用软件。微软所提供的备份程序只用于备份文件而不能备份系统,所以为了避免系统破坏后不便重新安装系统,对系统的备份与恢复是很必要的。当Windows9x在无法启动的情况下,而需要利用备份来恢复系统时,会遇到在DOS环境下无法生成长文件名的问题,若不恢复系统中的长文件名,则Windows9x又无法启动,因此,在非Windows9x(即是不支援长文件名的环境)的环境中生成长文件名就显得很必要了。In the process of actually using the computer, it is inevitable that the operating system will be damaged. For users who use Windows 95, reinstalling the operating system is often a complicated but necessary process. If the user does not have Backup, it is necessary to reinstall the application software by reinstalling. The backup program provided by Microsoft is only used to back up files but not the system, so in order to avoid the inconvenience of reinstalling the system after the system is damaged, it is necessary to back up and restore the system. When Windows9x cannot start, and needs to utilize backup to restore the system, it will run into the problem that the long file name cannot be generated under the DOS environment. If the long file name in the system is not restored, Windows9x cannot start again, so , it is necessary to generate long file names in an environment other than Windows9x (that is, an environment that does not support long file names).

本发明的目的在于提供一种能够在不支援长文件名的电脑环境中备份和恢复长文件名的方法。The object of the present invention is to provide a method capable of backing up and restoring long file names in a computer environment that does not support long file names.

本发明的另一目的在于提供一种不受电脑操作系统所属的语系影响,仍能在不支援长文件名的环境中备份和恢复长文件名的方法。Another object of the present invention is to provide a method for backing up and restoring long file names in an environment that does not support long file names, regardless of the language of the computer operating system.

本发明的又一目的在于提供一种对操作系统要求较低,仍可以在Windows完全不能启动的情况下,进行长文件名的备份和恢复的方法。Another object of the present invention is to provide a method for backing up and restoring long file names that has lower requirements on the operating system and can still be used when Windows cannot be started at all.

本发明的目的是这样实现的,其是通过调用电脑的基本输入输出系统(BIOS),自逻辑硬盘的分割区(Partition)中取得文件目录表(FDT),再将文件目录表中的长文件名项与短文件名项,对应转储存一长文件名备份文件,而完成长文件名的备份操作;然后在不支援长文件名的环境中,以备份长文件名的逆过程先搜寻每一个目录中的短文件名,再将备份文件中相应的长文件名写回至原来的文件目录表(FDT)中,绕开了DOS不支援长文件名的限制,而实现了在不支援长文件名的环境下备份和恢复长文件名的目的。The object of the present invention is achieved in that it obtains the file directory table (FDT) from the partition (Partition) of the logical hard disk by calling the basic input output system (BIOS) of the computer, and then the long file in the file directory table Name item and short file name item correspond to dumping and storing a long file name backup file to complete the long file name backup operation; then in an environment that does not support long file name, first search for each Short file names in the directory, and then write back the corresponding long file names in the backup file to the original file directory table (FDT), bypassing the limitation that DOS does not support long file names, and realizing The purpose of backing up and restoring long filenames in a named environment.

根据本发明所揭露的方法,由于可以在视窗操作系统(Windows)完全不能启动的情况下进行长文件名的备份和恢复,即是与操作系统的语系版本无关,例如:可以在简体中文Windows95中备份和恢复繁体Windows95中的长文件名文件,而不会产生文件名代码错误,至于其他的备份方法由于对Windows95本身的依赖,将无法解决文件名代码错误的问题。According to the disclosed method of the present invention, owing to can carry out the backup and recovery of long file name under the situation that window operating system (Windows) can't start completely, promptly be irrelevant with the language version of operating system, for example: can be in Simplified Chinese Windows95 Backup and recovery of long file name files in traditional Windows95 will not cause file name code errors. As for other backup methods, they will not be able to solve the problem of file name code errors due to their dependence on Windows95 itself.

下面结合附图,详细说明本发明的实施例,其中:Embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:

图1为实现本发明的电脑硬件结构图;Fig. 1 is the computer hardware structural diagram realizing the present invention;

图2为磁盘分割区的数据结构图;Fig. 2 is a data structure diagram of a disk partition;

图3为本发明备份长文件名的操作流程图;Fig. 3 is the operation flowchart of backing up long file name of the present invention;

图4为本发明恢复长文件名的操作流程图;Fig. 4 is the operation flowchart of the present invention recovery long file name;

图5为本发明在某一目录下生成长文件名备份文件的操作流程图;Fig. 5 is the operation flowchart of the present invention generating long file name backup file under a certain directory;

图6为本发明利用长文件名备份文件在电脑中恢复长文件名的操作流程图;Fig. 6 is the operation flowchart that the present invention utilizes long file name backup file to restore long file name in computer;

图7为本发明备份长文件名的主要步骤流程图;Fig. 7 is the flow chart of main steps of backup long file name of the present invention;

图8为图7中的局部流程图,显示在文件目录表(FDT)中搜寻并且生成长文件名备份文件的详细步骤;Fig. 8 is a partial flow chart among Fig. 7, shows to search in file directory table (FDT) and generate the detailed steps of long file name backup file;

图9为本发明恢复长文件名的主要步骤流程图;Fig. 9 is the flow chart of main steps of the present invention recovering long file name;

图10为图7中的局部流程图,显示在文件目录表(FDT)中搜寻并且恢复长文件名的详细步骤;Fig. 10 is a partial flow chart among Fig. 7, shows the detailed steps of searching and recovering the long file name in the file directory table (FDT);

图11为根据本发明的方法在长文件名备份文件中寻找长文件名的详细步骤流程图;Fig. 11 is the detailed step flow chart that searches for long file name in long file name backup file according to the method of the present invention;

图12为根据本发明的方法将长文件名备份文件的内容写入文件目录表中的详细步骤流程图。Fig. 12 is a flow chart of detailed steps of writing the content of the long file name backup file into the file directory table according to the method of the present invention.

首先请参考图1,本发明所揭露在不支援长文件名的环境中备份和恢复长文件名的方法,是通过在下列的硬件结构中的进行而实现,这些硬件结构包括有:Please refer to Fig. 1 first, the method for backing up and restoring long filenames in an environment that does not support long filenames disclosed by the present invention is realized by performing in the following hardware structures, and these hardware structures include:

一微处理单元10,用以执行本发明所揭露用以备份和恢复长文件名的操作程序;A micro-processing unit 10, used to execute the operation program disclosed by the present invention for backing up and restoring long file names;

一基本输入输出系统20(BIOS,Basic Input/Output System);A basic input and output system 20 (BIOS, Basic Input/Output System);

一硬盘30,用于储存电脑的操作系统、应用软件或文件等可供微处理单元10利用的数据;A hard disk 30 is used to store the operating system, application software or files of the computer and other data that can be utilized by the microprocessing unit 10;

一输入单元40,如键盘、鼠标器、光笔或其他功能类似的设备,用以输入数据;An input unit 40, such as a keyboard, a mouse, a light pen or other devices with similar functions, for inputting data;

一输出单元50,如屏幕、显示器、液晶显示屏,触控显示器或其他功能类似的设备,用以输出微处理单元10的处理结果;An output unit 50, such as a screen, a display, a liquid crystal display, a touch display or other devices with similar functions, is used to output the processing results of the micro-processing unit 10;

一随机存取存储器模组件60,用以寄存相关的处理数据;以及A random access memory module 60 for storing relevant processing data; and

一电源供给装置70,用以供给前述各元件运作所需的电能。A power supply device 70 is used to supply the electric energy required for the operation of the aforementioned components.

根据本发明所揭露的方法,是通过下列两个阶段加以实现长文件名的备份和恢复,包括有:According to the method disclosed in the present invention, the backup and recovery of long file names are realized through the following two stages, including:

1.备份长文件名成为一长文件名备份文件;以及1. The backup long filename becomes a long filename backup file; and

2.利用长文件名备份文件进行备份的逆过程,而完成长文件名的恢复。2. Use the backup file with a long file name to perform the reverse process of backup, and complete the recovery of the long file name.

在进一步详细说明以上两个阶段的详细技术内容之前,先就实施本发明技术的过程中有关长文件名与短文件名的知识作一说明。·磁盘的数据存储格式Before further detailing the detailed technical content of the above two stages, an explanation will be made on the knowledge about long file names and short file names in the process of implementing the technology of the present invention. · Disk data storage format

磁盘(如:硬式磁盘、软式磁盘)为电脑的周边设备之一,属于记录媒体的一种,用以存储操作系统、应用程序、数字数据、类比数据..等;不论是硬式磁盘或是软式磁盘在使用前都必须先经过“启始”,这个启始的过程就称为格式化(Formatting),目前在DOS和Windows环境下,磁盘的格式化方式可由微软公司提供的“Format”指令来进行,通过“Format”指令把磁盘分成许多个磁区(Sector),以及由磁区所合成的磁轨(Track);再分别对磁区与磁轨予以编号,并将与磁区、磁轨相关的数据写入预先建立的文件配置表(FAT,File Allocation Table)与文件目录表(FDT,File Directory Table)中。请参阅图2,为一磁盘分割区(Partition)的结构示意图,其中包括有一启动记录、第一文件配置表、第二文件配置表、文件目录区、以及数据记录区,而前述的文件目录区与数据记录区就是所谓文件目录表(FDT)的构成内容。其中文件目录区是由多个文件目录项(内含有短文件名目录项与相应的长文件名目录项)所组成,用以提供与储存于数据记录区内的数据相关的信息(如;文件名称、附加文件名、时间标示…等等)。Disk (such as: hard disk, floppy disk) is one of the peripheral devices of the computer, and it is a kind of recording medium, which is used to store operating system, application program, digital data, analog data, etc.; whether it is a hard disk or The floppy disk must be "initialized" before it can be used. This initial process is called formatting (Formatting). Currently, in DOS and Windows environments, the format method of the disk can be "Formatting" provided by Microsoft Corporation. command, divide the disk into many sectors (Sector) and the track (Track) synthesized by the sector through the "Format" command; Data is written into the pre-established file allocation table (FAT, File Allocation Table) and file directory table (FDT, File Directory Table). Please refer to Fig. 2, it is a structural diagram of a disk partition (Partition), which includes a boot record, a first file configuration table, a second file configuration table, a file directory area, and a data recording area, and the aforementioned file directory area The data recording area is the composition of the so-called file directory table (FDT). Wherein the file directory area is made up of a plurality of file directory entries (including short filename directory entries and corresponding long filename directory entries) to provide information related to the data stored in the data recording area (such as; file name, additional filename, timestamp...etc).

在前述的启动记录中还包括有一磁盘参数块(DPB,Disc ParameterBlock,以下简称为DPB),而此一DPB在FAT16与FAT32系统中的结构并不完全相同,其内容分别如[表一]以及[表二]所示。In the aforementioned startup record, there is also a disk parameter block (DPB, Disc ParameterBlock, hereinafter referred to as DPB), and the structure of this DPB in the FAT16 and FAT32 systems is not exactly the same, and its contents are as [Table 1] and [Table 2].

而短文件名目录项与长文件名目录项在FDT中的配置如[表三]所示。·长文件名项与短文件名项的结构The configuration of short file name directory items and long file name directory items in FDT is shown in [Table 3]. ·Structure of long file name item and short file name item

在视窗95(Windows95)中提供了一种利用8.3格式(短文件名格式)的目录项存储长文件名的方法。微软公司(Microsoft)称利用此方法的文件系统为虚拟文件分割表(VFAT.Virtual File Allocation Table)。根据此一文件系统存储的每一个长文件名都有一个对应的8.3格式别名。长文件名与短文件名被一同存储在一个文件目录表(FDT,File Directory Table,以下简称FDT),而每一个FDT则又包含了多个文件目录项(内含有短文件名目录项与相应的长文件名目录项),每一个长文件名目录项可以存储长文件名中的13个字元[长文件名是以通用码(UNICODE)形式存储,而每字元占2个比特(BYTE)],而为了区分FDT中的目录项是长文件名还是短文件名,Wmdows95将长文件名的目录属性比特设为“OF”,而“OF”属性在DOS下是非法的文件名,DOS无法对这种文件名进行存取,也不能进行更名或删除,所以这样的长文件名在DOS下就可以得到保护,而DOS则又可以通过其相应的短文件名在存取文件。In Windows 95 (Windows95), a method for storing long filenames using directory entries in the 8.3 format (short filename format) is provided. Microsoft (Microsoft) calls the file system using this method a virtual file partition table (VFAT. Virtual File Allocation Table). Every long filename stored according to this file system has a corresponding 8.3 format alias. Long file names and short file names are stored together in a file directory table (FDT, File Directory Table, hereinafter referred to as FDT), and each FDT contains multiple file directory entries (including short file name directory entries and corresponding long file name directory entry), each long file name directory entry can store 13 characters in the long file name [the long file name is stored in the form of universal code (UNICODE), and each character occupies 2 bits (BYTE )], and in order to distinguish whether the directory entry in FDT is a long file name or a short file name, Wmdows95 sets the directory attribute bit of the long file name to "OF", and the "OF" attribute is an illegal file name under DOS, DOS This file name cannot be accessed, renamed or deleted, so such a long file name can be protected under DOS, and DOS can access files through its corresponding short file name.

而有关长文件名目录项与短文件名目录项的格式请分别参考【表四】与【表五】的内容。For the format of the long file name directory entry and the short file name directory entry, please refer to [Table 4] and [Table 5] respectively.

下列所举的就是一个长文件名为:RunOnceEx Log.txt,相应的短文件名为RUNONC~1.TXT的文件在电脑中的存储形式:1370:04E0 42 2E 00  74 00  78 00  74-00  00 00 00 0F 00  D0 FF  FFThe following is a long file name: RunOnceEx Log.txt, and the corresponding short file name is RUNONC~1.TXT. The storage form of the file in the computer: 1370: 04E0 42 2E 00 74 00 78 00 74-00 00 00 00 0F 00 D0 FF FF

       B..t.x.t…….1370:04fD FF FF FF FF FF FF  FF FF  FF FF  00 00  FF FF FF FFB..t.x.t...1370:04fD FF FF FF FF FF FF FF FF FF FF 00 00 FF FF FF FF

       … … … … …..1370:0500 01 52 00  75 00 6E 00 4F-00  6E 00  0F 00 D0  63... ... ... ... ... ... 1370: 0500 01 52 00 75 00 6E 00 4F-00 6E 00 0F 00 D0 63

       00.R.u.n.O.n….c.1370:0510 65 00 45 00 78 00 20  00-4c 00 00 00 6f 00 67 00 e.E.x..L…o.g.1370:0520 52 55 4E 4F 4E 43 7E 31-54 58 54 20 00 15 2B 6D RUNONE~00.R.u.n.O.n...c.1370: 0510 65 00 45 00 78 00 20 00-4c 00 00 00 6f 00 67 00 e.E.x..L...o.g.1370: 0520 52 55 4E 4F 4E 43 7E 0 80 2 54 5 2B 6D RUNONE~

       1TXT..+m1370:0530 67 25 67 25 00 00 16 72-65 25 14 00 B3 45 00 00 g%g%…re  1TXT..+m1370: 0530 67 25 67 25 00 00 16 72-65 25 14 00 B3 45 00 00 g%g%…re

    %…E..%...E..

其中:in:

1370:04e0开始第32比特为:长文件名结束项1370: The 32nd bit starting from 04e0 is: end item of long file name

1370:0500开始第32比特为:长文件名项1370: The 32nd bit starting from 0500 is: long file name item

1370:0520开始第32比特为:短文件名目录项1370: The 32nd bit starting from 0520 is: short file name directory entry

Windows还可以通过对短文件名求校验和再与长文件名中的校验和进行比较,来判断短文件名是否在非Windows9x的环境中被修改。Windows can also determine whether the short file name has been modified in a non-Windows9x environment by calculating the checksum of the short file name and then comparing it with the checksum in the long file name.

所以,根据本发明所揭露的技术,就只要将文件目录区中的长文件名目录项和相应的短文件名目录项一同备份成为一长文件名备份文件,便可以在将来根据欲恢复长文件名的磁盘目录中的短文件名,再于长文件名备份文件中取得相应的长文件名目录项,而进行长文件名的恢复操作。·生成长文件名备份文件的操作流程Therefore, according to the technology disclosed in the present invention, as long as the long file name directory entry and the corresponding short file name directory entry in the file directory area are backed up together to form a long file name backup file, the long file can be restored in the future according to the desired The short file name in the disk directory of the first name, and then obtain the corresponding long file name directory entry in the long file name backup file, and perform the recovery operation of the long file name. ·The operation process of generating backup files with long file names

请参阅图3,本发明对长文件名进备的操作流程包括有:Please refer to Fig. 3, the present invention includes to the operation process that long file name is prepared:

1.根据分割表(Partition Table),查找硬盘30的分割区(Partition)的第一个扇区(即磁盘参数块,DPB,Disk Parameter Block);1. According to the partition table (Partition Table), search for the first sector (i.e. disk parameter block, DPB, Disk Parameter Block) of the partition (Partition) of the hard disk 30;

2.将分割区中的文件目录表(FDT)内含的长文件名项与短文件名项备份存储于当前的目录下,成为一长文件名备份文件;2. The long file name item and the short file name item backup stored in the file directory table (FDT) in the partition are stored under the current directory, and become a long file name backup file;

3.向下搜寻子目录的文件目录表(FDT);3. Search down the file directory table (FDT) of the subdirectory;

4.将子目录的文件目录表(FDT)内含的长文件名项与短文件名项备份存储于当前子目录的长文件名备份文件之中;以及4. The long file name item and the short file name item backup stored in the file directory table (FDT) of the subdirectory in the long file name backup file of the current subdirectory; and

5.判断是否还有子目录未完成备份?若为是,同返回至步骤4,若为否,则结束备份操作。5. Determine whether there are subdirectories that have not been backed up yet? If yes, return to step 4, and if no, end the backup operation.

请参阅图5,在生成长文件名备份文件的过程中,由于在同一个FDT之中可能包括有多个非为长文件名格式的短文件名,如图中的短文件名1~短文件名3,就不会有相应的长文件名存在,而这些短文件名1-短文件名3的短文件名项在将来恢复长文件名的操作中,将没有任何的用处,因此本发明在把FDT内含的长文件名项和短文件名项一起存储而生成一长文件名备份文件之后,还会再将长文件名备份文件中不含有相应的长文件名项的短文件名予以去除,也就是去掉无用的短文件名信息。Please refer to Figure 5. During the process of generating a backup file with a long file name, the same FDT may include multiple short file names that are not in the format of a long file name, as shown in the short file name 1 to short file in the figure. name 3, there will be no corresponding long file name to exist, and the short file name items of these short file name 1-short file name 3 will not have any use in the operation of restoring long file names in the future, so the present invention is in After storing the long file name items and short file name items contained in FDT together to generate a long file name backup file, the short file names that do not contain the corresponding long file name items in the long file name backup file will be removed , that is, to remove useless short file name information.

继续请参阅图7,其为本发明备份长文件名的主要实施步骤流程图,其包括有:Continue referring to Fig. 7, it is the flow chart of main implementation steps of backup long file name of the present invention, and it comprises:

1.开始执行备份;1. Start the backup;

2.读取待备份的硬盘的磁盘参数块(DPB)的内容,取得文件系统的识别码(FSID,File System ID);2. Read the content of the disk parameter block (DPB) of the hard disk to be backed up, and obtain the identification code (FSID, File System ID) of the file system;

3.判断FSID,若为FAT16,则继续下一步骤,若为FAT32,则跳至步骤6,若以上二者皆非,则跳至步骤9;3. Determine the FSID, if it is FAT16, continue to the next step, if it is FAT32, then skip to step 6, if neither of the above two, then skip to step 9;

4.计算启动记录表(BDT,Boot Directory Table)的位置;4. Calculate the location of the boot record table (BDT, Boot Directory Table);

5.设BDT的大小(磁盘容量/磁簇);5. Set the size of BDT (disk capacity/magnetic cluster);

6.取得BDT的起始;6. Get the start of BDT;

7.计算BDT起始位置;7. Calculate the BDT starting position;

8.搜寻所有的文件目录表FDT,并且在当前的搜寻目录下生成长文件名的备份文件;以及8. Search all file directory tables FDT, and generate a backup file with a long file name under the current search directory; and

9.结束备份操作。9. End the backup operation.

在图7的备份流程中,首先根据分割表(Partition Table)中欲备份的磁盘代码(如C:\),查找其根目录的位置,就FAT16而言,为FAT后的第一个扇区,就FAT32而言,通常位于第二个磁簇,当然也可以从DPB中得到FAT32的根目录位置。取得根目录之后就可以对根目录以及所有子目录执行长文件名的备份操作。In the backup process in Figure 7, firstly, according to the disk code (such as C:\) to be backed up in the partition table (Partition Table), look for the location of its root directory. As far as FAT16 is concerned, it is the first sector after FAT , as far as FAT32 is concerned, it is usually located in the second disk cluster, of course, the root directory location of FAT32 can also be obtained from DPB. After obtaining the root directory, you can perform a backup operation with long file names on the root directory and all subdirectories.

前述的步骤8还包括下列步骤:(请参阅图8)Aforesaid step 8 also comprises the following steps: (seeing Fig. 8)

1.判断当前目录下的长文件名备份文件生成操作是否结束?若为是,则跳至步骤5,若为否,则继续下一步骤;1. Determine whether the long file name backup file generation operation in the current directory is over? If yes, skip to step 5, if no, continue to the next step;

2.读取一文件目录项并存入当前目录下的长文件名备份文件;2. Read a file directory entry and store it in the backup file with long file name in the current directory;

3.判断这个文件目录项是否为长文件名结束项?若为是,则进行下一步骤,若为否,则返回至步骤1;3. Determine whether the file directory item is the end item of the long file name? If yes, proceed to the next step, if no, return to step 1;

4.备份并保存成一位于当前目录下的长文件名备份文件,然后返回至步骤1;4. Back up and save as a backup file with a long file name located in the current directory, and then return to step 1;

5.设起始文件目录项为当前目录;5. Set the initial file directory item as the current directory;

6.判断当前目录下的所有长文件名备份文件生成操作是否结束?若为是,则结束长文件名备份文件的生成操作,若为否,则继续下一步骤;6. Determine whether the operation of generating backup files with long file names in the current directory is over? If yes, then end the generation operation of the long file name backup file, if no, then continue to the next step;

7.读取一文件目录项并存入当前目录下的长文件名备份文件;7. Read a file directory entry and store it in the backup file with long file name in the current directory;

8.判断这个文件目录项是否为子目录?若为是,则进行下一步骤,若为否,则返回至步骤6;以及8. Determine whether the file directory item is a subdirectory? If yes, proceed to the next step, if no, return to step 6; and

9.递回处理下一个子目录,然后返回至步骤6。9. Recursively process the next subdirectory, then return to step 6.

在图8中所示的生成流程中,其中搜寻FDT并且备份保存长文件名(LFN,Long File Name)的方式,是采用两次搜寻的方法进行,第一次搜寻时,分析所有扇区并保存所有的长文件名项以及相应的短文件名项,而第二次搜寻时,则是分析所有的子目录,进行纵深搜寻,保存所有子目录中的所有长文件名项以及相应的短文件名项。In the generation process shown in Figure 8, the method of searching for FDT and backing up and saving the long file name (LFN, Long File Name) is carried out by means of two searches. When searching for the first time, all sectors are analyzed and Save all long file name items and corresponding short file name items, and in the second search, analyze all subdirectories, perform a deep search, and save all long file name items and corresponding short file names in all subdirectories name item.

由于本发明采用递回的处理方式,经计算采用此种方式可以处理深度达40级的子目录。如果在递回时不保留当前目录的话,可以将递回深度增加到80级以上,不但适用于FAT16的文件系统,也适用于FAT32的文件系统。·恢复长文件名的操作流程Since the present invention adopts a recursive processing method, it is calculated that subdirectories with a depth of 40 levels can be processed by using this method. If you do not keep the current directory when recursing, you can increase the recursive depth to more than 80 levels, which is not only applicable to the file system of FAT16, but also applicable to the file system of FAT32. ·The operation process of restoring long file names

请参阅图4,其为本发明根据长文件名备份文件恢复长文件名的操作流程,恢复的步骤基本上就是对长文件名进行备份操作的逆过程,其包括有:Please refer to Fig. 4, it is the operation process that the present invention restores long file name according to long file name backup file, and the step of restoring is exactly the inverse process of backing up operation to long file name basically, and it comprises:

1.根据分割表(Partition Table),查找硬盘30的分割区(Partition)的第一个扇区(即磁盘参数块,DPB,Disk Parameter Block);1. According to the partition table (Partition Table), search for the first sector (i.e. disk parameter block, DPB, Disk Parameter Block) of the partition (Partition) of the hard disk 30;

2.依据分割区中文件目录表(FDT)内含的全部短文件名项,在长文件名备份文件中找到相应的内容(包含短文件名项与相应的长文件名项),然后在此目录下的文件目录表(FDT)中将相应的短文件名项替换为备份文件中所对应的短文件名项与相应的长文件名项;而成为一个新的文件目录项(如图6所示);2. According to all the short file name items contained in the file directory table (FDT) in the partition, find the corresponding content (including the short file name item and the corresponding long file name item) in the long file name backup file, and then here In the file directory table (FDT) under the directory, the corresponding short file name item is replaced with the corresponding short file name item and the corresponding long file name item in the backup file; and become a new file directory item (as shown in Figure 6 Show);

3.向下搜寻子目录的文件目录表(FDT);3. Search down the file directory table (FDT) of the subdirectory;

4.依据子目录下的文件目录表(FDT)内含的全部短文件名项,在长文件名备份文件中找到相应的内容(包含短文件名项与相应的长文件名项),然后在此子目录下的文件目录表(FDT)中将相应的短文件名项替换为备份文件中所对应的短文件名项与相应的长文件名项,而成为一个新的文件目录项(如图4所示);以及4. According to all the short file name items contained in the file directory table (FDT) under the subdirectory, find the corresponding content (comprising the short file name item and the corresponding long file name item) in the long file name backup file, and then in In the file directory table (FDT) under this subdirectory, replace the corresponding short file name item with the corresponding short file name item and corresponding long file name item in the backup file, and become a new file directory item (as shown in the figure 4); and

5.判断是否还有子目录未完成长文件名项的恢复操作?若为是,则返回至步骤4,若为否,则结束恢复操作。5. Determine whether there are subdirectories that have not completed the recovery operation of long file name items? If yes, return to step 4, and if no, end the recovery operation.

继续请参阅图9,其为本发明恢复长文件名的主要实施步骤流程图,其包括有:Continue referring to Fig. 9, it is the flow chart of main implementation steps of the present invention to restore long file name, and it includes:

1.开始执行恢复操作;1. Start the recovery operation;

2.读取待恢复的硬盘中FDT的文件目录区内容;2. Read the content of the file directory area of FDT in the hard disk to be recovered;

3.在当前的目录下寻找长文件名备份文件;3. Find the long file name backup file in the current directory;

4.判断是否找到长文件名备份文件?若为是,则继续下一步骤,若为否,则跳至步骤9;4. Determine whether to find a long file name backup file? If yes, continue to the next step, if no, skip to step 9;

5.恢复长文件名,是依据当前目录中文件目录表(FDT)内含的所有短文件名项,在长文件名备份文件中找到相应的内容(包括短文件名项与相应的长文件名项),然后在此目录下的文件目录表(FDT)中将相应的短文件名项替换为前述备份文件中所对应的短文件名项与相应的长文件名项,而成为一个新的文件目录项;5. Restoring long file names is based on all short file name items contained in the file directory table (FDT) in the current directory, and finds the corresponding content in the long file name backup file (including short file name items and corresponding long file name items) item), then in the file directory table (FDT) under this directory, replace the corresponding short file name item with the corresponding short file name item and the corresponding long file name item in the aforementioned backup file, and become a new file directory entry;

6.寻找当前目录的子目录;6. Find the subdirectories of the current directory;

7.判断是否存在子目录?若为是,则进行下一步骤,若为否,则跳至步骤9;7. Determine whether there are subdirectories? If yes, proceed to the next step, if no, skip to step 9;

8.恢复当前子目录下的长文件名,然后返回至步骤6递回处理其他的子目录;以及8. Restore the long file name under the current subdirectory, and then return to step 6 to recursively process other subdirectories; and

9.结束恢复操作。9. End the restore operation.

在图9的备份流程中,同样是根据分割表(Partition Table)中欲备份的磁盘代码(如C:\),查找其根目录的位置,就FAT16而言,是为FAT后的第一个扇区,就FAT32而言,通常位于第二个磁簇,当然也可以从DPB中得到FAT32的根目录位置。取得根目录之后就可以对根目录以及所有子目录中的短文件名项,转换成一个包含短文件名项与相应的长文件名项的新文件目录项,而完成长文件名的恢复操作。In the backup process of Figure 9, the location of the root directory is also searched according to the disk code (such as C:\) to be backed up in the partition table (Partition Table). As far as FAT16 is concerned, it is the first one after FAT Sectors, as far as FAT32 is concerned, are usually located in the second magnetic cluster, and of course the root directory location of FAT32 can also be obtained from DPB. After the root directory is obtained, the short file name items in the root directory and all subdirectories can be converted into a new file directory item including the short file name item and the corresponding long file name item, and the recovery operation of the long file name is completed.

前述图9中对于恢复长文件名的详细步骤如10图所示,包括有:As shown in Figure 10, the detailed steps for recovering long file names in the aforementioned Figure 9 include:

1.从磁盘的当前目录中读取一短文件名项;1. Read a short filename entry from the current directory on the disk;

2.判断是否结束长文件名的恢复,若为是,则结束此一目录的长文件名恢复操作,若为否,则继续下一步骤;2. judge whether to end the recovery of the long file name, if yes, then end the long file name recovery operation of this directory, if not, continue to the next step;

3.在当前目录中寻找长文件名备份文件;3. Look for the long file name backup file in the current directory;

4.判断是否找到长文件名备份文件?若为是,则继续下一步骤,若为否,则返回至步骤1;4. Determine whether to find a long file name backup file? If yes, proceed to the next step, if no, return to step 1;

5.寄存短文件名项的信息;5. Information about storing short file name items;

6.删除短文件名项;6. Delete the short file name item;

7.自长文件名备份文件中移入包含有相同的短文件名项以及相应的长文件名项;以及7. Move in items containing the same short filename and corresponding long filename entries from the long filename backup file; and

8.修改短文件名项所指向的文件第一个磁族,使其与刚才删除的短文件名项一致,然后返回至步骤1。8. Modify the first magnetic group of the file pointed to by the short file name item to make it consistent with the short file name item just deleted, and then return to step 1.

在图10中的处理流程中,是从文件目录区中取得一个短文件名,然后在同一目录下的长文件备份文件中查找其相应的长文件名项(其步骤流程如图11所示),如果查到则删除文件目录区中的短文件名,然后将长文件备份文件中的短文件名项与相应的长文件名项一起加入到文件目录区中(其步骤流程如图12所示),再修改短文件名项所指向的文件的第一磁簇,使其与刚删除的短文件名项一致。In the processing flow in Fig. 10, obtain a short file name from the file directory area, then search for its corresponding long file name item in the long file backup file under the same directory (the step flow is shown in Fig. 11) , then delete the short file name in the file directory area if found, then add the short file name item in the long file backup file together with the corresponding long file name item in the file directory area (its step process is as shown in Figure 12 ), and then modify the first disk cluster of the file pointed to by the short file name item to make it consistent with the short file name item just deleted.

以下就以表六所示的一实例来说明,在同一目录下的长文件名,其在备份前和系统破坏后以及利用本发明的方法恢复后的内容。In the following, an example shown in Table 6 is used to illustrate the long file names in the same directory, the content before backup, after the system is destroyed and after utilizing the method of the present invention to recover.

而在这个实施例的结果可以看见,本发明在系统破坏后,可以把仅存的短文件名恢复到了备份前的情形。     位置 内容 0B-0C 每个磁区内的字元数(此处为0x0002,即512) 0D 每个磁簇内的磁区数(个数由分割区大小决定) 0E-0F 保留磁区(0x0100) 10 FAT的个数(0x02) 11-12 文件目录项的最大值(此处为0x0002) 13-14 磁区总数(当大于65535个时此处为0) 15 媒体描述符(为0xf8) 16-17 每个FAT的磁区数 18-19 每个磁轨的磁区数 1A-1B 磁头数 1C-1D 隐藏磁区数(不影响结果) 20-23 13-14字元处为0时的磁区总数 24 物理驱动器号(第一块为0x80,第二块为0x81...) 25 保留 26 扩展引导记录的特征字元(为0x29) 27-2A 磁盘序号(随机产生) 2B-35 标签(共11个字) 36-3D 文件系统类型(即FAT16) And in the result of this embodiment, it can be seen that the present invention can restore the only remaining short file name to the situation before the backup after the system is destroyed. Location content 0B-0C The number of characters in each sector (here is 0x0002, which is 512) 0D The number of magnetic sectors in each magnetic cluster (the number is determined by the size of the partition) 0E-0F Reserved sector (0x0100) 10 Number of FAT (0x02) 11-12 The maximum value of the file directory entry (0x0002 here) 13-14 Total number of magnetic areas (here is 0 when more than 65535) 15 Media descriptor (0xf8) 16-17 Number of sectors per FAT 18-19 Number of sectors per track 1A-1B Number of heads 1C-1D Number of hidden sectors (does not affect the result) 20-23 The total number of magnetic sectors when the 13-14 characters are 0 twenty four Physical drive letter (0x80 for the first block, 0x81 for the second...) 25 reserve 26 The characteristic character of the extended boot record (0x29) 27-2A Disk serial number (randomly generated) 2B-35 Label (11 characters in total) 36-3D File system type (ie FAT16)

         【表一】、FAT16的结构 位置 内容 0B-0C 每个磁区内的字元数(此处为0x0002,即512) 0D 每个磁簇内的磁区数(个数由分割区大小决定) 0E-0F 保留磁区(0x0100) 10 FAT的个数(0x02) 11-12 文件目录项的最大值(此处为0) 13-14 磁区总数(此处为0) 15 媒体描述符(为0xf8) 16-17 每个FAT的磁区数(此处为0) 18-19 每个磁轨的磁区数 1A-1B 磁头数 1C-1F 隐藏磁区数(不影响结果) 20-23 13-14字元处为0时的磁区总数 24-27 磁区总数 28-29 File System Ver(major)(为0即可) 2A-2B File System Ver(minor)(为0即可) 2C-2D 文件目录头簇号(为0x02000) 2E-2F 文件目录头簇号的高比特 30-31 FSINFO Sector number(若无,则为0xffff) 32-33 Backup Boot Sector(若无,则为0xffff) 34-3F 保留 40 物理驱动器号(第一块为0x80,第二块为0x81...) 41 保留 42 扩展引导记录的特征字元(为0×29) 43-46 磁盘序号(随机产生) 47-51 标签(共11个字) 52-59 文件系统类型(即FAT32) [Table 1], the structure of FAT16 Location content 0B-0C The number of characters in each sector (here is 0x0002, which is 512) 0D The number of magnetic sectors in each magnetic cluster (the number is determined by the size of the partition) 0E-0F Reserved sector (0x0100) 10 Number of FAT (0x02) 11-12 The maximum value of file directory entries (0 here) 13-14 Total number of sectors (0 here) 15 Media descriptor (0xf8) 16-17 Number of sectors per FAT (0 here) 18-19 Number of sectors per track 1A-1B Number of heads 1C-1F Number of hidden sectors (does not affect the result) 20-23 The total number of magnetic sectors when the 13-14 characters are 0 24-27 Total number of sectors 28-29 File System Ver(major) (0 is enough) 2A-2B File System Ver(minor) (0 is enough) 2C-2D File directory header cluster number (0x02000) 2E-2F The high bit of the file directory header cluster number 30-31 FSINFO Sector number (0xffff if none) 32-33 Backup Boot Sector (0xffff if none) 34-3F reserve 40 Physical drive letter (0x80 for the first block, 0x81 for the second...) 41 reserve 42 The characteristic character of the extended boot record (0×29) 43-46 Disk serial number (randomly generated) 47-51 Label (11 characters in total) 52-59 File system type (i.e. FAT32)

 【表二】FAT32的结构 长文件名目录项(含结束标志) 长文件名目录项 …… …… …… 长文件名目录项 短文件名目录项 [Table 2] The structure of FAT32 Long file name directory entry (including end flag) long file name directory entry ... ... ... long file name directory entry short file name directory entry

       【表三】长/短文件名目录项在FDT中的配置   位移量     长度                描述     00H     1BYTE BIT0~5为目录项相对于短文件名的位置,BIT6为结束标志     01H     10BYTE 句含长文件名的5个字元     0BH     1BYTE 属性,长文件名为0FH     0CH     1BYTE 保留     0DH     1BYTE 短文件名校验和     0EH     12BYTE 包含长文件名的6个字元     1AH     1WORD(字组) 保留(恒为0)     1CH     4BYTE 包含长文件名的2个字元 [Table 3] Configuration of long/short file name directory items in FDT displacement length describe 00H 1BYTE BIT0~5 is the position of the directory entry relative to the short file name, and BIT6 is the end sign 01H 10BYTE Sentences containing 5 characters for long filenames 0BH 1BYTE attribute, the long file name is 0FH 0CH 1BYTE reserve 0DH 1BYTE short filename checksum 0EH 12BYTE 6 characters containing the long filename 1AH 1WORD (word group) Reserved (constantly 0) 1CH 4BYTE 2 characters containing the long filename

            【表四】长文件名目录项的格式   位移量    长度                 描述     00H   8BYTE 短文件名部分     08H   3BYTE 短文件名的延伸文件名部分     0BH   1BYTE 文件属性     0CH   1WORD 保留     0EH   1WORD 最后的存取日期     10H   1WORD 最后的更新时间     12H   1WORD 最后的更新日期     14H   1WORD FAT32起始磁簇的高2位     16H   1WORD 最后的更新时间     18H   1WORD 最后的更新日期     1AH   1WORD FAT16起始磁簇或FAT32起始磁簇的低2位     1CH   1WORD 文件的大小 [Table 4] Format of directory entries with long file names displacement length describe 00H 8BYTE short filename part 08H 3BYTE The extended filename part of the short filename 0BH 1BYTE file properties 0CH 1 WORD reserve 0EH 1 WORD last access date 10H 1 WORD last update time 12H 1 WORD last update date 14H 1 WORD The upper 2 bits of the FAT32 start magnetic cluster 16H 1 WORD last update time 18H 1 WORD last update date 1AH 1 WORD The lower 2 bits of the FAT16 initial magnetic cluster or the FAT32 initial magnetic cluster 1CH 1 WORD file size

        【表五】短文件名目录项的格式备份前存有以上三个长文件名文件的目录:1370:0460  42 4C 41 43 4B 54 7E 31-42 4D 50 20 00 0F 2B 6D  BLACKT-1BMP..+m1370:0470  67 25 67 25 00 00 20 A0-AB 24 0D 00 B6 00 00 00  g%g%.. ..$......1370:0480  42 6E 00 20 00 53 00 61-00 76 00 0F 00 6B 65 00  Bn..S.a.v..ke.1370:0490  72 00 2E 00 53 00 43 00-52 00 00 00 00 00 FF FF  r...S.C.R.......1370:04A0  01 43 00 68 00 61 00 6E-00 6E 00 0F 00 6B 65 00  .C.h.a.n.n...ke.1370:04B0  6C 00 20 00 53 00 63 00-72 00 00 00 65 00 65 00  l..S.c.r...e.e.1370:04C0  43 48 41 4E 4E 45 7E 31-53 43 52 20 00 10 2B 6D  CHANNE~1SCR..+m1370:04D0  67 25 67 25 00 00 20 A0-AB 24 0E 00 40 48 01 00  g%g%.. [email protected]:04E0  42 2E 00 74 00 78 00 74-00 00 00 0F 00 D0 FF FF  B..t.x.t........1370:04F0  FF FF FF FF FF FF FF FF-FF FF 00 00 FF FF FF FF  ................1370:0500  01 52 00 75 00 6E 00 4F-00 6E 00 0F 00 D0 63 00  .R.u.n.O.n....c.1370:0510  65 00 45 00 78 00 20 00-4C 00 00 00 6F 00 67 00  e.E.x. .L...o.g.1370:0520  52 55 4E 4F 4E 43 7E 31-54 58 54 20 00 15 2B 6D  RUNONC~1TXT..+m1370:0530  67 25 67 25 00 00 16 72-65 25 14 00 B3 45 00 00  g%g%...re%...E..1370:0540  42 69 00 66 00 00 00 FF-FF FF FF 0F 00 23 FF FF  Bi.f.........#..1370:0550  FF FF FF FF FF FF FF FF-FF FF 00 00 FF FF FF FF  ................1370:0560  01 45 00 78 00 69 00 74-00 20 00 0F 00 23 54 00  .E.x.i.t....#T.1370:0570  6F 00 20 00 44 00 6F 00-73 00 00 00 2E 00 70 00  o..D.o.s......p1370:0580  45 58 49 54 54 4F 7E 31-50 49 46 20 00 1E 2B 6D  EX1TTO~1PIF..+m1370:0590  67 25 67 25 00 00 EC 49-66 25 16 00 C7 03 00 00  g%g%...1f%......Windows95系统破坏后的该目录:1370:0460  42 4C 41 43 4E 54 7E 31-42 4D 50 20 00 0F 2B 6D  BLACKT~1BMP..+m1370:0470  67 25 67 25 00 00 20 A0-AB 24 0D 00 B6 00 00 00  g%g%.. ..S......1370:0480  43 48 41 4E 4E 45 7E 31-53 43 52 20 00 10 2B 6D  CHANNE~1SCR..+m1370:0490  67 25 67 25 00 00 20 A0-AB 24 0E 00 40 48 01 00  g%g%.. [email protected]:04AB  52 55 4E 4F 4E 43 7E 31-54 58 54 20 00 15 2B 6D  RUNONC~ITXT..+m1370:04B0  67 25 67 25 00 00 16 72-65 25 14 00 B3 45 00 00  g%g%...re%...E..1370:04C0  45 58 49 54 54 4F 7E 31-50 49 46 20 00 1E 2B 6D  EXITTO~1PIF..+m1370:04D0  67 25 67 25 00 00 EC 49-66 25 16 00 C7 03 00 00  g%g%...If%......利用本发明进行恢复后的同一个目录1370:0000  42 4C 41 43 4B 54 7E 31-42 4D 50 20 00 0F 2B 6D  BLACKT~1BMP..+m1370:0010  67 25 67 25 00 00 20 A0-AB 24 0D 00 B6 00 00 00  g%g%.. ..S......1370:0020  42 6E 00 20 00 53 00 61-00 76 00 0F 00 6B 65 00  Bn..S.a.v...ke.1370:0030  72 00 2E 00 53 00 43 00-52 00 00 00 00 00 FF FF  r...S.C.R.......1370:0040  01 43 00 68 00 61 00 6E-00 6E 00 0F 00 6B 65 00  .C.h.a.n.n...ke.1370:0050  6C 00 20 00 53 00 63 00-72 00 00 00 65 00 65 00  l..S.c.r...e.e.1370:0D60  43 48 41 4E 4E 45 7E 31-53 43 52 20 00 10 2B 6D  CHANNE~1SCR..+m1370:0070  67 25 67 25 00 00 20 A0-AB 24 0E 00 40 48 01 00  g%g%.. [email protected]:0080  42 2E 00 74 00 78 00 74-00 00 00 0F 00 D0 FF FF  B..t..x.t........1370:0090  FF FF FF FF FF FF FF FF-FF FF 00 00 FF FF FF FF  ................1370:00A0  01 52 00 75 00 6E 00 4F-00 6E 00 0F 00 D0 63 00  .R.u.n.O.n....c.1370:00B0  65 00 45 00 78 00 20 00-4C 00 00 00 6F 00 67 00  e.E.x..L...o.g.1370:00C0  52 55 4E 4F 4E 43 7E 31-54 58 54 20 00 15 2B 6D  RUNONC~1TXT..+m1370:00D0  67 25 67 25 00 00 16 72-65 25 14 00 B3 45 00 00  g%g%...re%...E..1370:00E0  42 69 00 66 00 00 00 FF-FF FF FF 0F 00 23 FF FF  Bi.f.........#..1370:00F0  FF FF FF FF FF FF FF FF-FF FF 00 00 FF FF FF FF  ................1370:0100  01 45 00 78 00 69 00 74-00 20 00 0F 00 23 54 00  .E..x.i.t. ...#T.    .1370:0110  6F 00 20 00 44 00 6F 00-73 00 00 0C 2E 00 70 00  o..D.o.s.....p.1370:0120  45 58 49 54 54 4F 7E 31-50 49 46 20 00 IE 2B 6D  EXITTO~1PIF..+m1370:0130  67 26 67 25 00 00 EC 49-66 25 16 00 C7 03 00 00  g%g%...If%......[Table 5] The format of the short file name directory item The directory with the above three long file name files before backup: 1370: 0460 42 4C 41 43 4B 54 7E 31-42 4D 50 20 00 0F 2B 6D BLACKT-1BMP.. +m1370: 0470 67 25 67 25 00 00 20 A0-AB 24 0D 00 B6 00 00 00 g%g%.. ..$...1370: 0480 42 6E 00 20 00 53 00 61-00 76 00 0F 00 6B 65 00 Bn..S.a.v..ke.1370:0490 72 00 2E 00 53 00 43 00-52 00 00 00 00 00 FF FF r...S.C.R......1370:04A0 01 43 00 68 00 61 00 6E-00 6E 00 0F 00 6B 65 00 .C.h.a.n.n...ke.1370: 04B0 6C 00 20 00 53 00 63 00-72 00 00 00 65 00 65 00 l..S.c.r300e.e... 43 48 41 4E 4E 45 7E 31-53 43 52 20 00 10 2B 6D CHANNE~1SCR..+m1370: 04D0 67 25 67 25 00 00 20 A0-AB 24 0E 00 40 48 01 00 g%g%.. [email protected]:04E0 42 2E 00 74 00 78 00 74-00 00 00 0F 00 D0 FF FF B..t.x.t........1370:04F0 FF FF FF FF FF FF FF FF -FF FF 00 00 FF FF FF FF ... 1370:0500 01 52 00 75 00 6E 00 4F-00 6E 00 0F 00 D0 63 00 .R.u.n.O.n... c.1370: 0510 65 00 45 00 78 00 20 00-4C 00 00 00 6F 00 67 00 e.E.x. .L...o.g.1370: 0520 52 55 4E 4F 4E 43 7E 31-54 58 54 54 20 UNB 6 ~1TXT..+m1370: 0530 67 25 67 25 00 00 16 72-65 25 14 00 B3 45 00 00 g%g%...re%...E..1370: 0540 42 69 00 66 00 00 00 FF-FF FF FF 0F 00 23 FF FF Bi.f..........#..1370:0550 FF FF FF FF FF FF FF FF-FF FF 00 00 FF FF FF FF ..... ..........1370: 0560 01 45 00 78 00 69 00 74-00 20 00 0F 00 23 54 00 .E.x.i.t....#T.1370: 0570 6F 00 20 00 44 00 6F 00 -73 00 00 00 2E 00 70 00 o..D.o.s......p1370: 0580 45 58 49 54 54 4F 7E 31-50 49 46 20 00 1E 2B 6D EX1TTO~1PIF..+m1370: 0590 67 25 67 25 00 00 EC 49-66 25 16 00 C7 03 00 00 g%g%...1f%...This directory after the Windows95 system is destroyed: 1370:0460 42 4C 41 43 4E 54 7E 31-42 4D 50 20 00 0F 2B 6D BLACKT~1BMP..+m1370: 0470 67 25 67 25 00 00 20 A0-AB 24 0D 00 B6 00 00 00 g%g%.. ..S......1370: 0480 43 48 41 4E 4E 45 7E 31-53 43 52 20 00 10 2B 6D CHANNE~1SCR..+m1370: 0490 67 25 67 25 00 00 20 A0-AB 24 0E 00 40 48 01%g00%.g [email protected]:04AB 52 55 4E 4F 4E 43 7E 31-54 58 54 20 00 15 2B 6D RUNONC~ITXT..+m1370:04B0 67 25 67 25 00 00 16 72-65 25 14 00 B3 45 00 00 g%g%...re%...E..1370:04C0 45 58 49 54 54 4F 7E 31-50 49 46 20 00 1E 2B 6D EXITTO~1PIF..+m1370:04D0 67 25 67 25 00 00 EC 49-66 25 16 00 C7 03 00 00 g%g%...If%...the same directory 1370:0000 after recovery using the present invention 42 4C 41 43 4B 54 7E 31-42 4D 50 20 00 0F 2B 6D BLACKT~1BMP..+m1370: 0010 67 25 67 25 00 00 20 A0-AB 24 0D 00 B6 00 00 00 g%g%.. ..S.... ..1370: 0020 42 6E 00 20 00 53 00 61-00 76 00 0F 00 6B 65 00 Bn..S.a.v...ke.1370: 0030 72 00 2E 00 53 00 43 00-52 00 00 00FF 00 0 r...S.C.R....1370: 0040 01 43 00 68 00 61 00 6E-00 6E 00 0F 00 6B 65 00 .C.h.a.n.n...ke.1370: 0050 6C 00 20 00 53 00 63 00-72 00 00 00 65 00 65 00 l..S.c.r...e.e.1370: 0D60 43 48 41 4E 4E 45 7E 31-53 43 52 20 00 10 2B 6D CHANNE~1SCR..+m1370: 0070 0 0 25 0 67 A0-AB 24 0E 00 40 48 01 00 g%g%.. [email protected]:0080 42 2E 00 74 00 78 00 74-00 00 00 0F 00 D0 FF FF B..t. .x.t........1370:0090 FF FF FF FF FF FF FF FF-FF FF 00 00 FF FF FF FF ..........1370:00A0 01 52 00 75 00 6E 00 4F-00 6E 00 0F 00 D0 63 00 .R.u.n.O.n....c.1370: 00B0 65 00 45 00 78 00 20 00-4C 00 00 00 6F 00 67 00 e.E.x..13o... :00C0 52 55 4E 4F 4E 43 7E 31-54 58 54 20 00 15 2B 6D RUNONC~1TXT..+m1370:00D0 67 25 67 25 00 00 16 72-65 25 14 00 B3 0 45 g%0% ..re%...E..1370: 00E0 42 69 00 66 00 00 00 FF-FF FF FF 0F 00 23 FF FF Bi.f......#..1370: 00F0 FF FF FF FF FF FF FF FF-FF FF 00 00 FF FF FF FF ..........1370:0100 01 45 00 78 00 69 00 74-00 20 00 0F 00 23 54 00 .E..x.i.t. ...#T. .1370: 0110 6F 00 20 00 44 00 6F 00-73 00 00 0C 2E 00 70 00 o..D.o.s.....p.1370: 0120 45 58 49 54 54 4F 7E 31-50 49 46 20 00 IE 2B 6D EXITTO~1PIF..+m1370: 0130 67 26 67 25 00 00 EC 49-66 25 16 00 C7 03 00 00 g%g%...If%.. ....

                       【表六】【Table 6】

本发明方法的优点在于:The advantage of the inventive method is:

1.可以在不支援长文件名的电脑环境中备份和恢复长文件名。1. It is possible to back up and restore long file names in a computer environment that does not support long file names.

2.不受电脑操作系统所属的语系影响,仍能在不支援长文件名的环境中备份和恢复长文件名。2. It is not affected by the language of the computer operating system, and it can still backup and restore long file names in an environment that does not support long file names.

3.对操作系统要求较低,仍可以在Windows完全不能启动的情况下,进行长文件名的备份和恢复操作。3. The requirements for the operating system are low, and the backup and recovery operations of long file names can still be performed when Windows cannot be started at all.

Claims (7)

1.一种在电脑中备份和恢复文件的长文件名的方法,是应用于个人电脑中,用以在不支援长文件名的环境下,备份和恢复文件的长文件名,其特征在于,包括有:1. A method for backing up and restoring the long file name of a file in a computer, which is applied in a personal computer, and used for backing up and restoring the long file name of a file in an environment that does not support the long file name, is characterized in that, Including: 1)自逻辑磁盘的分割区(Partition)中取得一文件目录表(FDT),再将该文件目录表中的一长文件名项与一短文件名项,对应转储成为一包含有该短文件名项与相应的该长文件名项的长文件名备份文件;以及1) Obtain a file directory table (FDT) from the partition (Partition) of the logical disk, and then dump a long file name item and a short file name item in the file directory table into a file containing the short file name. a filename entry and a corresponding long filename backup file for that long filename entry; and 2)以备份该长文件名的逆过程,搜寻每一个该文件目录表及文件子目录表中的短文件名,再将该备份文件中相应的该长文件名写回至原来的该文件目录表(FDT)中。2) With the reverse process of backing up the long file name, search for each short file name in the file directory table and file subdirectory table, and then write back the corresponding long file name in the backup file to the original file directory table (FDT). 2.如权利要求1所述在电脑中备份和恢复文件的长文件名的方法,其特征在于,备份该长文件名备份文件是由下列的步骤来实现的:2. the method for backing up and recovering the long file name of file in computer as claimed in claim 1, is characterized in that, backing up this long file name backup file is realized by following steps: 1)根据该磁盘的分割表(Partition Table),查找该磁盘的分割区(Partition)的磁盘参数块(DPB,Disk Parameter Block);1) Find the disk parameter block (DPB, Disk Parameter Block) of the partition (Partition) of the disk according to the partition table (Partition Table) of the disk; 2)将该分割区中的文件目录表(FDT)内含有的一长文件名项与一短文件名项备份存储于当前的目录下,成为一长文件名备份文件;2) a long file name item and a short file name item backup stored in the file directory table (FDT) in the partition are stored under the current directory, and become a long file name backup file; 3)向下搜寻子目录的文件目录表(FDT);3) Search down the file directory table (FDT) of the subdirectory; 4)将子目录的该文件目录表(FDT)内含的一长文件名项与一短文件名项备份存储于当前子目录的长文件名备份文件之中;以及4) a long file name item and a short file name item contained in the file directory table (FDT) of the subdirectory are backed up and stored in the long file name backup file of the current subdirectory; and 5)判断是否还有子目录未完成备份?若为是,则返回至步骤4,若为否,则结束备份操作。5) Determine whether there are subdirectories that have not been backed up yet? If yes, return to step 4, and if no, end the backup operation. 3.如权利要求1所述在电脑中备份和恢复文件的长文件名的方法,其特征在于,恢复该长文件名备份文件的方法包括有:3. the method for backing up and recovering the long file name of file in computer as claimed in claim 1, is characterized in that, the method for recovering this long file name backup file comprises: 1)根据该分割表(Partition Table),查找该磁盘的分割区(Partition)的磁盘参数块(DPB,Disk Parameter Block);1) Find the disk parameter block (DPB, Disk Parameter Block) of the partition (Partition) of the disk according to the partition table (Partition Table); 2)依据该分割区中的一文件目录表(FDT)内含的全部短文件名项,在该长文件名备份文件中找到与所述短文件名项相对应的短文件名项与相应的长文件名项,然后在该目录下的文件目录表(FDT)中将相应的该短文件名项替换为该备份文件中所对应的该短文件名项与该相应的长文件名项,而成为一个新的文件目录项;2) According to all the short file name items contained in a file directory table (FDT) in the partition, find the short file name item corresponding to the short file name item and the corresponding short file name item in the long file name backup file. Long file name item, then in the file directory table (FDT) under this directory, the corresponding short file name item is replaced with the corresponding short file name item and the corresponding long file name item in the backup file, and become a new file directory entry; 3)向下搜寻子目录的文件目录表(FDT);3) Search down the file directory table (FDT) of the subdirectory; 4)依据该子目录下的该文件目录表(FDT)内含的全部短文件名项,在该长文件名备份文件中找到相应的内容,然后在该子目录下的文件目录表(FDT)中将相应的该短文件名项替换为该备份文件中所对应的该短文件名项与该相应的长文件名项,而成为一个新的文件目录项;以及4) According to all the short file name items contained in the file directory table (FDT) under the subdirectory, find the corresponding content in the long file name backup file, and then in the file directory table (FDT) under the subdirectory Replace the corresponding short file name item with the corresponding short file name item and the corresponding long file name item in the backup file to become a new file directory item; and 5)判断是否还有子目录未完成长文件名项的恢复操作?若为是,则返回至步骤4,若为否,则结束备份操作。5) Determine whether there are subdirectories that have not yet completed the recovery operation of the long file name item? If yes, return to step 4, and if no, end the backup operation. 4.如权利要求3所述在电脑中备份和恢复文件的长文件名的方法,其特征在于,该步骤中所称在该长文件名备份文件中的该相应内容,包含有一短文件名项与相应的长文件名项。4. the method for backing up and recovering the long file name of file in computer as claimed in claim 3, it is characterized in that, said corresponding content in this long file name backup file in this step includes a short file name item with the corresponding long filename entry. 5.一种在不支援长文件名的电脑环境中备份文件的长文件名的方法,其特征在于,包括有:5. A method for backing up a long file name of a file in a computer environment that does not support a long file name, characterized in that it includes: 1)开始执行备份;1) Start the backup; 2)读取待备份的硬盘的磁盘参数块(DPB)的内容,取得文件系统的识别码(FSID,File System ID);2) read the content of the disk parameter block (DPB) of the hard disk to be backed up, obtain the identification code (FSID, File System ID) of the file system; 3)判断该FSID,若为FAT16,则继续下一步骤,若为FAT32,则跳至步骤6,若以上二者皆非,则跳至步骤9;3) Determine the FSID, if it is FAT16, then continue to the next step, if it is FAT32, then skip to step 6, if neither of the above two, then skip to step 9; 4)计算启动记录表(BDT,Boot Directory Table)的位置;4) Calculate the position of the boot record table (BDT, Boot Directory Table); 5)设BDT的大小(磁盘容量/磁簇);5) Set the size of BDT (disk capacity/magnetic cluster); 6)取得BDT的起始;6) Get the start of BDT; 7)计算BDT起始位置;7) Calculate the BDT starting position; 8)搜寻所有的文件目录表(FDT),并且在当前的搜寻目录下生成一长文件名的备份文件;以及8) Search all file directory tables (FDT), and generate a backup file with a long file name under the current search directory; and 9)结束备份操作。9) End the backup operation. 6.如权利要求5所述在电脑中备份和恢复文件的长文件名的方法,其特征在于,该步骤8还包括有:6. the method for backing up and recovering the long file name of file in computer as claimed in claim 5, is characterized in that, this step 8 also comprises: 1)判断当前目录下的长文件名备份文件生成操作是否结束?若为是,则跳至步骤5,若为否,则继续下一步骤;1) Determine whether the long file name backup file generation operation in the current directory is over? If yes, skip to step 5, if no, continue to the next step; 2)读取一文件目录项并存入当前目录下的长文件名备份文件;2) read a file directory entry and save it into a backup file with a long file name under the current directory; 3)判断该文件目录项是否为长文件名结束项?若为是,则进行下一步骤,若为否,则返回至步骤);3) Judging whether the file directory item is the end item of the long file name? If yes, proceed to the next step, if no, return to step); 4)备份并保存成一位于当前目录下的长文件名备份文件,然后返回至步骤1;4) back up and save into a long file name backup file located in the current directory, then return to step 1; 5)设起始文件目录项为当前目录;5) Set the initial file directory item as the current directory; 6)判断当前目录下的所有长文件名备份文件生成操作是否结束?若为是,则结束长文件名备份文件的生成操作,若为否,则继续下一步骤;6) Judging whether the generation operation of all backup files with long file names in the current directory is over? If yes, then end the generation operation of the long file name backup file, if no, then continue to the next step; 7)读取一文件目录项并存入当前目录下的长文件名备份文件;7) read a file directory item and store it in the backup file with long file name under the current directory; 8)判断这个文件目录项是否为子目录?若为是,则进行下一步骤,若为否,则返回至步骤6;以及8) Determine whether the file directory item is a subdirectory? If yes, proceed to the next step, if no, return to step 6; and 9)递回处理下一个子目录,然后返回至步骤6。9) Recursively process the next subdirectory, then return to step 6. 7.如权利要求6所述在电脑中备份和恢复文件的长文件名的方法,其特征在于,该文件目录项包含有一短文件名项与一相应的长文件名项。7. The method for backing up and restoring long filenames of files in a computer according to claim 6, wherein the file directory entry includes a short filename entry and a corresponding long filename entry.
CN 99102485 1999-03-04 1999-03-04 How to Backup and Restore Files with Long File Names on Your Computer Expired - Fee Related CN1098498C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 99102485 CN1098498C (en) 1999-03-04 1999-03-04 How to Backup and Restore Files with Long File Names on Your Computer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 99102485 CN1098498C (en) 1999-03-04 1999-03-04 How to Backup and Restore Files with Long File Names on Your Computer

Publications (2)

Publication Number Publication Date
CN1266234A CN1266234A (en) 2000-09-13
CN1098498C true CN1098498C (en) 2003-01-08

Family

ID=5270839

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 99102485 Expired - Fee Related CN1098498C (en) 1999-03-04 1999-03-04 How to Backup and Restore Files with Long File Names on Your Computer

Country Status (1)

Country Link
CN (1) CN1098498C (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
ZA200509273B (en) * 2004-12-17 2008-12-31 Microsoft Corp Extensible file system
US7788230B2 (en) 2007-01-23 2010-08-31 International Business Machines Corporation Backing-up and restoring files including files referenced with multiple file names

Also Published As

Publication number Publication date
CN1266234A (en) 2000-09-13

Similar Documents

Publication Publication Date Title
CN1277213C (en) A flash memory file system management method
US8069320B1 (en) System and method for consolidation of backups
CN1195273C (en) System and method for durable and firm allocation of storage device
CN1226687C (en) Systems and methods for persistent and robust storage management
CN1959672A (en) Optimized startup verification of file system integrity
CN1540672A (en) Power Management Data Block for Non-Volatile Storage Systems
CN1662905A (en) Multi-way Parallel Active File System
KR102406666B1 (en) Key-value storage device supporting snapshot function and method of operating the key-value storage device
US20070276848A1 (en) Apparatus and method for managing data
JP2007012056A (en) File system with deferred authentication of data integrity
JP2007012060A (en) File system with reverse hierarchical structure
CN101042703A (en) Method for managing metadata of file system using dbms
CN1848118A (en) Device and method for managing file system
CN1492362A (en) Data back up and recovering method of embedded data bank
CN1975721A (en) Method and apparatus for managing content file information, and medium of storing program
CN101051320A (en) File name generating method and device in file distribution system
CN1622116A (en) Image retrieval device and image display device and method therefor
KR101008032B1 (en) Meta-data management system and method
CN1773509A (en) Computer file system
CN101051283A (en) Hard disk data backup system and method
CN102609531B (en) Method for pegging files according to keywords
EP3542273B1 (en) Systems and methods for recovering lost clusters from a mounted volume
CN1719422A (en) Virtual access method of storage document data
CN1098498C (en) How to Backup and Restore Files with Long File Names on Your Computer
CN1147800C (en) Computer system and method for preparing computer readable media

Legal Events

Date Code Title Description
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C06 Publication
PB01 Publication
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20030108

Termination date: 20110304