Practical task. Creation of a data archive. Extracting data from the archive. File attributes and size

Topic: Creating a data archive. Extracting data from the archive. File attributes and size

How does information compression occur?

Data compression is similar to the production of milk powder or dried fruits. That is, it is a process of removing water, which can then be added to restore the product to its original form.

What kind of water could be in the data? This is informational water. There are many repetitions in the data. This can be used to compress data.

For example, compression of text files goes something like this. A table of words and expressions found in the text is compiled. All words and expressions in this table are then given numbers. And all the text in the file is replaced with numbers from the table of words and expressions. This method allows you to reduce the size of a text file by 2-3 times. Sometimes the text is compressed 10 times if it contains a lot of repetitions.

A program that converts a text file into a “compressed” form is called a packer. And the resulting file is called a packed or compressed file.

Very often, compressed files are called archives or archive files, which, strictly speaking, is incorrect. Initially, archives were files specifically created during backup processes. This process created one file that contained several source files and folders. This was the archive. No compression was performed. A similar situation still exists in the operating room. Linux system, where data archiving and data compression are two independent processes. In the operating room MS-DOS system, and then to MS Windows programs data compression from its very first versions began to support both data compression and archiving, that is, they created compressed file, containing not one, but several source (archived) files and folders. Since then, in these operating systems, the concept of “archiving” means both archiving (collection into one archive file) and simultaneous compression data.

Since the archive file is not written in text format, text editors cannot work with it. Before opening archive file This file must be unzipped using a text editor. Unzipping is performed by the same program - the archiver. After unzipping, the text file takes on exactly the same appearance and size as before archiving.

Text archivers can also archive program files. Only programs are much less compressed than text.

Packers used to compress text and programs cannot effectively compress audio, image or video files. Other, more complex algorithms have been developed to compress them. True, after unpacking, the resulting files differ slightly from the originals (this compression is called lossy compression). But this is not captured by the ordinary human ear and is not noticed by the ordinary eye on the monitor screen.

But what about other, non-text data?

Let's look at graphic files. Unarchived graphics are a drawing consisting of many multi-colored dots. In this format, a color is specified for each point in a drawing or photograph. The graphic file of such a drawing has the extension “BMP”. But such files are quite large in size. Even a small photo in BMP format will be several megabytes in size. That is, it will not fit on a floppy disk, and it will not be easy to transfer it over the Internet.

To reduce the size of a graphic file, it is compressed with special mathematical methods. Thus, the graphic file can be reduced in size by 20-30 times. A compressed graphic file cannot be fully recovered. When printing on good printer There will be a noticeable deterioration in the quality of the drawing. But this will not be visible on the monitor screen.

The most common image compression formats are “GIF” and “JPEG” (or “JPG”). Such graphic file formats can be created, for example, graphics editor“PhotoShop” or the already familiar “FineRider”. The deeper the image is compressed, the more quality it loses.

They appeared much later effective methods sound compression. If you go to regular music cd, you will find files with the extension “CDA” there. Such files contain uncompressed digital audio. Such files are very big size. A CD contains 80 minutes of unarchived music. Compression of sound files required special research into human hearing. It turned out that some sounds can be removed from the sound file, and this will be imperceptible to human hearing.

Most common format compressed audio– this is “MPEG3” (or “MP3”). It's being created specialized editors sound and transcoding programs from other sound formats. Playing compressed audio files in MP3 format on a computer requires a processor power of at least 100 megahertz. Can be compressed sound file tens of times. But with high compression, sound quality begins to be irretrievably lost.

The video combines sound and graphics. In addition to sound, this is another 24 frames for every second. This explains the huge size of video files and the need to compress them.

When CDs first appeared, a feature film could not fit on one disc. This problem was solved by the compressed format “MPEG4”. Displaying compressed video further increases the demands on processor power. To play MPEG4, 200 megahertz is no longer enough.

Archiving(packaging) - placing (downloading) source files into an archive file in compressed or uncompressed form.

Archiving is intended to create backup copies of used files in case of loss or damage for any reason to the main copy (user carelessness, damage to magnetic disk, virus infection, etc.).

Used for archiving special programs, archivers who carry out packaging and make it possible to reduce the size of the archive, compared to the original, by approximately two or more times.

Archivers allow you to protect the archives they create with a password, save and restore the structure of subdirectories, and write a large archive file to several disks (multi-volume archive).

Either one or several files can be compressed, which in compressed form are placed in a so-called archive file or archive. Large programs distributed on floppy disks are also located on them in the form of archives.

Practical task

Topic: Creating a data archive. Extracting data from the archive. File attributes and size

Target: studying the principles of file archiving, functions and operating modes of the most common archivers, acquiring practical skills in creating archive files and extracting files from archives.

Equipment and materials: practical task, computer, WinZip, WinRar archivers.

Theoretical information to the practical task

Archiving(packaging) - placing (downloading) source files into an archive file in compressed or uncompressed form.

Archiving is intended to create backup copies of used files in case the main copy is lost or damaged for any reason (user carelessness, magnetic disk damage, virus infection, etc.).

For archiving, special programs are used, archivers that carry out packaging and make it possible to reduce the size of the archive, compared to the original, by approximately two or more times.

Archivers allow you to protect the archives they create with a password, save and restore the structure of subdirectories, and write a large archive file to several disks (multi-volume archive).

Either one or several files can be compressed, which in compressed form are placed in a so-called archive file or archive. Large programs distributed on floppy disks are also located on them in the form of archives.

Archive file- this is in a special way organized file, containing one or more files in compressed or uncompressed form and service information about file names, the date and time of their creation or modification.

The gain in archive size is achieved by replacing frequently occurring code sequences in the file with links to the first detected sequence and using information compression algorithms.

The degree of compression depends on the program used, the compression method and the type source file. Files are compressed best graphic images, text files and data files, for which the compression ratio can reach 5 - 40%, files are compressed less executable programs and loading modules - 60 - 90%. Archive files are almost not compressed. Archiving programs differ in the compression methods they use, which consequently affects the compression ratio.

In order to use the information packed in the archive, you need to open or unpack the archive. This is done either by the same archiver program or by a paired unarchiver program.

Unzipping(unpacking) - the process of restoring files from an archive to original form. When unpacking, files are extracted from the archive and placed on disk or in RAM.

Self-extracting archive file- this is bootable, executable module, which is capable of independently unzipping the files contained in it without using an archiver program.

The self-extracting archive is called SFX archive (SelF-eXtracting). Archives of this type are usually created in the form of an .EXE file.

Archivers used to compress and store information provide the representation of one or more files in a single archive file, each of which can be retrieved in its original form if necessary. IN table of contents of the archive file for each file it contains is stored the following information:

    • file name;

      information about the directory in which the file is contained;

      date and time latest modification file;

      file size on disk and in archive;

      A round-robin code for each file used to check the integrity of the archive.

Archivers have the following functionality :

    1. Reducing the required amount of memory for storing files from 20% to 90% of the original volume.

      Updating in the archive only those files that have changed since they were last added to the archive, i.e. The packer program itself monitors changes made by the user to the archived files and places only new and changed files in the archive.

      Combining a group of files with storing directory names with file names in the archive, which allows you to restore them when unzipping complete structure directories and files.

      Writing comments on the archive and files in the archive.

      Creating self-extracting archives that do not require the archiver itself to extract files.

      Creation of multi-volume archives – sequences of archive files. Multi-volume archives intended for archiving large complexes files onto floppy disks.

Task No. 1

Prepare the objects needed for archiving.

Procedure for completing task No. 1

    In the operating room Windows system create a folder Archives by the address My documents\Technical school\Technical school\1st year\Group\Last name\TEMP. Create folders Pictures And Documents by the address

My documents\Technical school\Technical school\1st year\Group\Last name\Archives.

    Find and copy to folder Pictures two drawings with extension * .jpg And * .bmp .

    Compare file sizes *.bmp And *.jpg . and write the data into table_1.

    To folder Documents place the files *.doc (at least 3) and write them down original dimensions to table_1.

Task No. 2

Archive files and extract files from the archive using WinZip program

Procedure for completing task No. 2

    Run WinZip 7. (Start →All Programs → 7-Zip→7ZipFileManager ).

    In the dialog box that appears, select the folder in which the archive will be created: My documents\Technical school\Technical school\1st year\Group\Last name\Archives\Pictures. Place the cursor on the name of the graphic file Winter.jpg. Run the command Add (+).

    Enter the archive name in the field ArchiveWinter.zip and make sure that in the field Archive format type set Zip.

    Set to field Change mode: add and replace.

    In the dropdown list Compression level: select item Normal. OK.

    Compare the size of the original file with the size of the archive file. Write the data in table_1.

    Create an archive Winter1.zip, password protected. To enter a password in the dialog box Add to archive in field Enter password: enter the password in the field Repeat password: Confirm the password. Please note the checkbox Show password. If it is not set, the password will not be displayed on the screen when entered, and its characters will be replaced by the wildcard character "*". This is a measure to protect your password from outsiders. However, in in this case the user cannot be sure that he entered the password correctly. Therefore, if the checkbox is not checked, the system requests a repeated (control) password entry. Click the button OK- the process of creating a protected archive will begin.

    Select the archive Winter1.zip, run the command Extract. In the dialog box that appears Extract in field Unpack to: select the destination folder - My documents\Technical school\Technical school\1st year\Group\Last name\Archives\Pictures\Winter1\.

    Click the button OK. The process of extracting data from the archive will not start, but instead a dialog box will open to enter a password.

    Make sure the input Not correct password does not allow you to extract files from the archive.

    Make sure that entering the correct password actually starts the process.

    Delete the protected archive you created and the extracted files.

    Create a self-extracting ZIP archive. To do this, place the cursor on the archive name Winter.zip, run the command Add (+).

    Enter the archive name in the field ArchiveWinter.7z and make sure that in the field Archive format type set 7 z .

    Set to field Change mode: add and replace.

    Check the box CreateSFX -archive.

    In the dropdown list Compression level: select item Normal. Start the archiving process with the button OK.

    Similarly, create archives for the files Rowan.bmp, Document1.doc, Document2.doc, Document3.doc. Comparative characteristics enter the source files and their archives into table_1.

Task No. 3

Archive files using WinRar and determine their compression percentage.

Procedure for completing task No. 3

Table_ 1

Archivers

Source file size

Text files:

1. Document1.doc

2. Document2.doc

3. Document3.doc

Graphic files:

1. Winter.jpg

2.Rowan.bmp

Compression percentage text information (for all files)

Compression percentage graphic information (for all files)

Task No. 4

Answer the control questions for the practical assignment

Task No. 5

1. Draw a conclusion about the practical task completed.

2. Submit the report to the teacher.

Control questions

    What is archiving?

    What is archiving used for??

    What file is called an archive file?

    What is unzipping??

    What information is stored in the table of contents of an archive file?

    What functionality do archivers have?

1. Purpose of the work: studying the principles of file archiving, functions and operating modes of the most common archivers, acquiring practical skills in creating archive files and extracting files from archives, acquiring CD burning skills.

2. Equipment, devices, equipment, materials: Personal Computer, OS Windows, WinRar archivers, WinZip.

3. Brief theoretical information.

Data archives. Archiving.

Archiving is intended to create backup copies of used files in case the main copy is lost or damaged for any reason (user carelessness, magnetic disk damage, virus infection, etc.).

For archiving, special programs are used, archivers that carry out packaging and make it possible to reduce the size of the archive, compared to the original, by approximately two or more times.

Archivers allow you to protect the archives they create with a password, save and restore the structure of subdirectories, and write a large archive file to several disks (multi-volume archive).

Either one or several files can be compressed, which in compressed form are placed in a so-called archive file or archive. Large programs distributed on floppy disks are also located on them in the form of archives.

Archive file - this is a specially organized file containing one or more files in compressed or uncompressed form and service information about the names of the files, the date and time of their creation or modification.

The gain in archive size is achieved by replacing frequently occurring code sequences in the file with links to the first detected sequence and using information compression algorithms.

The degree of compression depends on the program used, the compression method, and the type of source file. The most well-compressed files are graphic images, text files and data files, for which the compression ratio can reach 5 - 40%; files of executable programs and load modules are compressed less - 60 - 90%. Archive files are almost not compressed. Archiving programs differ in the compression methods they use, which consequently affects the compression ratio.

In order to use the information packed in the archive, you need to open or unpack the archive. This is done either by the same archiver program or by a paired unarchiver program.

Unzipping (unpacking) - the process of restoring files from an archive in their original form. When unpacking, files are extracted from the archive and placed on disk or in RAM.

Self-extracting archive file is a bootable, executable module that is capable of independently unzipping the files contained in it without using an archiver program.

The self-extracting archive is called SFX archive (SelF-eXtracting). Archives of this type are usually created in the form of an .EXE file.

Archivers used to compress and store information provide the representation of one or more files in a single archive file, each of which can be retrieved in its original form if necessary. The table of contents of an archive file stores the following information for each file it contains:

    file name;

    information about the directory in which the file is contained;

    date and time of the last modification of the file;

    file size on disk and in archive;

    A round-robin code for each file used to check the integrity of the archive.

Archivers have the following functionality:

    Reducing the required amount of memory for storing files from 20% to 90% of the original volume.

    Updating in the archive only those files that have changed since they were last added to the archive, i.e. The packer program itself monitors changes made by the user to the archived files and places only new and changed files in the archive.

    Combining a group of files while storing directory names with file names in the archive, which allows you to restore the full structure of directories and files when unzipping.

    Writing comments on the archive and files in the archive.

    Creating self-extracting archives that do not require the archiver itself to extract files.

    Creation of multi-volume archives – sequences of archive files. Multi-volume archives are designed for archiving large sets of files onto floppy disks.

Burning files to a CD

If your computer is equipped with an appropriate device, you can burn files to a CD using the built-in tools of the operating system Microsoft Windows XP. To do this you need to do the following actions:

Open My Computer window double click mouse on the corresponding icon located on the Desktop Windows desktop;

Click right key mouse on the CD burner icon, select Properties in the context menu, and in the window that opens, go to the Burning tab (see figure).

Select the Allow CD burning on this device checkbox;

In the menu below, select one of the disk partitions for temporary storage of the burnable CD image. This disk partition must contain at least 1 GB of free space;

In the Select Write Speed ​​menu, specify the speed at which data will be written to the CD. It should be taken into account that in this case the unit of data recording speed is taken to be 150 KB/s. In other words, if, for example, recording is carried out at a speed of 32x, this means that the maximum possible speed for recording information on this device will be 150*32=4800 KB/s;

If you want the CD to be automatically ejected from the device when burning is complete, check the Automatically eject CD after burning checkbox;

Click OK to close the CD burner properties window.

Immediately before burning to a CD, the files selected by the user are placed in a temporary folder in which an image of the future CD is created. Until recording, the contents of this image can be edited by adding or removing files and folders in the temporary directory. When creating a disk image, remember that the total volume of data copied to the CD should not exceed the maximum allowable volume of the CD, which is 680, and in some cases - 700 MB.

In order to copy any files or folders to a CD, you need to select them in the Explorer window with the mouse, and then click on the Copy selected objects item in the Tasks for files and folders panel, which is located on the left side of the Explorer window. In the Copy Items dialog box that opens, click on the CD burner and click the Copy button. In the Notification Area Panel Windows tasks a message will appear stating that operating system found files waiting to be burned to CD. To view the files and folders that make up the CD image, double-click the CD burner icon in the My Computer window.

It must be remembered that during the CD burning process, the recording device must receive a continuous stream of data from hard drive your computer. If the transmission of the information flow is interrupted for some reason, the recording head of the device will continue to direct the laser beam to the surface of the rotating CD, but no data will be recorded. This situation will inevitably lead to a failure during the recording process, and the CD itself will be damaged. To avoid such troubles, it is recommended to adhere to the following simple rules:

Before you start recording, you need to make sure that the surface of the CD is free of dust and scratches;

    close all unnecessary windows this moment applications: calling a program to hard drive(For example, automatic saving text document) may cause the CD to fail to burn;

    disable screen savers, which can automatically start during a recording session;

    while burning a CD, do not launch any applications, do not copy, move, or delete files and folders;

    If possible, burn the CD at low speed.

It must be remembered that to create a temporary folder in which the burnable CD image is stored, the operating system uses free place on the computer's hard drive. If there is not enough disk space, recording may not take place. IN similar situation you will need to release the missing disk space: This can be done by emptying the Trash, deleting unnecessary files and folders by uninstalling little-used applications or defragmenting the disk.

If you are using a CD-RW (CD-RW) and there is still free space left after burning is completed, you can later add files to the already burned CD using the CD Burning Wizard.

4. Task

Exercise 1 .

    1. In the operating systemWindowsCreate a folder on your desktop called Archives, in which create folders Pictures and Documents.

      Find and copy two pictures with *.jpg and *.bmp extensions to the Pictures folder.

      Compare the sizes of *.bmp and *.jpg files. and record the data in Table 1.

      Place *.doc files (at least 3) in the Documents folder and write down their original sizes in table_1.

Task 2. Archiving WinZip files

    1. Launch WinZip 7. (Start>All Programs>7-Zip>7ZipFileManager).

      In the dialog box that appears, select the folder in which the archive will be created: ...\Desktop\Archives\Pictures. Place the cursor on the name of the graphic file Winter.jpg. Run the Add (+) command.

      Enter the name of the archive in the Archive – Winter field.zipand make sure that the Archive format field is set to Zip.

      From the Compression Level: drop-down list, select Normal. Start the archiving process with the OK button.

      Compare the size of the original file with the size of the archive file. Write the data in table_1.

      Create an archive Winter1.zip, password protected. To enter a password in the Add to archive dialog box, in the Enter password field: enter the password, in the Repeat password field: confirm the password. Pay attention to the Show password checkbox. If it is not set, the password will not be displayed on the screen when entered, and its characters will be replaced by the wildcard character "*". This is a measure to protect your password from outsiders. However, in this case, the user cannot be sure that he entered the password correctly. Therefore, if the checkbox is not checked, the system requests a repeated (control) password entry. Click on the OK button - the process of creating a protected archive will begin.

      Select the Winter1 archive.zip, execute the Extract command. In the Extract dialog box that appears, in the Unpack to: field, select the destination folder - ...Desktop\Archives\Pictures\Winter1\.

      Click OK. The process of extracting data from the archive will not start, but instead a dialog box will open to enter a password.

      Make sure that entering an incorrect password will not allow you to extract files from the archive.

      Make sure that entering the correct password actually starts the process.

      Delete the protected archive you created and the extracted files.

      Create a self-extracting ZIP archive. To do this, place the cursor on the name of the Winter archive.zip, use the Add (+) command.

      Enter the name of the archive in the Archive – Winter field.7zand make sure that the Archive format field is set to type 7z.

      Set the Edit mode field to: add and replace.

      Check the Create boxSFX-archive.

      Start the archiving process with the OK button.

      bmp,Document1.doc,Document2.doc,Document3.doc. Comparative characteristics of the source files and their archives are included in table_1.

Task 3. Archiving WinRar files

    1. RunWinRar(Start > All Programs >WinRar).

      In the dialog box that appears, select the folder in which the archive will be created: Desktop\Archives\Pictures.

      Place the cursor on the name of the graphic file Winter.jpg.

      Execute the Add command. In the dialog box that appears, enter the name of the archive Zima.rar. Select the new archive format - RAR, compression method - Normal. Make sure that in the Archiving Options group there are no checkboxes in any of the boxes. Click the OK button to create the archive. During archiving, a window with statistics is displayed. When archiving is complete, the statistics window will disappear, and the created archive will become the currently selected file.

      Create archives for Rowan files in the same way.bmp,Document1.doc,Document2.doc,Document3.doc. Comparative characteristics of the source files and their archives are included in Table 1.

      Create a self-extractingRAR– an archive that includes text and graphic files.

      Determine the percentage of file compression and fill out table_1. The compression percentage is determined by the formula P=S/S 0 , where S is the size of the archive files, So is the size of the original files.

Table 1

Archivers

Practical work No. 22

Subject: Creation of a data archive. Extracting data from the archive. File attributes and size

Target: studying the principles of file archiving, functions and operating modes of the most common archivers, acquiring practical skills in creating archive files and extracting files from archives.

Completing of the work:

Task No. 1.

    In your folder, create a folder Archives. Create folders in it Images And Documentation.

    Find and copy to folder Images drawings with extensions * .jpg , *.bmp And *. gif .

    Compare file sizes *.bmp, *. gif .And *.jpg . and write the data into table_1.

    To folder Documentation place the files *.doc (at least 3) and write down their original sizes in table No. 1.

Task No. 2.

Archive files to Rar format

    Run WinRar.

    In the dialog box that appears, select the folder in which the archive will be created: (Archives/Images). Place the cursor on the name of the graphic file Landscape1.jpg. Run the command Add (+).

    Enter the archive name in the field ArchiveLandscape1.rar and make sure that in the field Archive format type set Rar.

    Set to field Change mode: add and replace.

    In the dropdown list Compression level: select item Normal. OK.

    Compare the size of the original file with the size of the archive file. Record the data in table No. 1.

    To extract files from the archive, create a folder Extracted inside the folder Images. Select the archive Landscape1.rar, run the command Extract. In the dialog box that appears Extract in field Unpack to: select the destination folder – Archives/Images/Extracted.

    Create a self-extracting Rar-archive. To do this, place the cursor on the file name Landscape1.jpg, run the command Add (+).

    Enter the archive name in the field ArchiveLandscape1.exe and make sure that in the field Archive format type set exe.

    Set to field Change mode: add with file replacement.

    Check the box CreateSFX-archive.

    In the dropdown list Compression level: select item Ordinary. Start the archiving process with the button OK.

    Similarly, create archives for the files Landscape2.gif, Landscape3.bmp? Document1.doc, Document2.doc, Document3.doc. Comparative characteristics of the source files and their archives are included in table No. 1.

Task No. 3. Archiving files in the formatZip

Archivers

Source file size

WinRar

WinRZip

Text files:

1. Document1.doc

2. Document2.doc

3. Document3.doc

Graphic files:

1. Landscape1.jpg

2. Landscape2.gif

3. Landscape3.bmp

Compression percentage text information (for all files)

Compression percentage graphic information (for all files)