Computer operating system file management code

【Operating System】File storage management linked table method, for code

C language to do, huh, do not know there is no use, sent out

#include “stdafx.h”

#include<stdio.h>

#include<iostream .h>

#include<string.h>

#include<iomanip.h>

constintMAXJOB=100;//define the maximum number of records in the table

typedefstructnode< /p>

{

intfront;

intlength;

chardata[20];

}job;

jobfrees[MAXJOB];//define free zone table

intfree_quantity;

joboccupys[MAXJOB];//define allocated zone table

intoccupy_quantity;

//initialization function

voidinitial()

{

inti;

for(i=0;i& lt;MAXJOB;i++)

{

frees[i].front=-1;

frees[i].length=0;

strcpy(frees[i].data, “free”);

occupys[i]. front=-1;

occupys[i].length=0;

strcpy(occupys[i].data, “”);

}

free_quantity=0;

occupy_quantity=0;

}

//Create free partition table

intcreatfree()

{

FILE*fp;

charfname[20];

cout<< “Please enter the filename of the source of the data file for the free partition:”;

cin>>fname;

if((fp=fopen(fname, “r”))==NULL){

cout<< “Error, file can’t be opened, please check the filename”<<endl;

Repeat

else{

while(!feof(fp))

{

fscanf(fp,”%d\t%d\n”,&frees[free_quantity].front,&frees[free_quantity].length);

free_quantity++;

}

cout<< “Free partition table created! \n”;

return1;

}

return0;

}

…………. Not finished yet

Hope this helps!

Seek to understand how to write code about linux operating system Network Management Experiment 1. create a new file test.c to check its permissions

touchtest.c

ls-ltest.c

chmod444test.c

vitest.c

# include <stdio.h>

main ()

{

printf(“Hello World!\n”);

}

cc-otesttest.c

ls-l

chmod666test< /p>

. /test

chmod+xtest

. /test

chmod742test.c

vi/etc/sysconfig/network-scripts/ifcfg-eth0

Compose it yourself

Just find an address to ping

.

How to manage files in your computer

If you have a lot of pictures, documents and other files in your computer, they may be very cluttered and inconvenient to use. So, for your own convenience in using your computer, it is best to follow the following method to organize and group your files wisely. The following introduction is based on the Windows operating system as an example, however, this method is also suitable for other operating systems.

Steps/Methods

1 Understand a few places that are prone to confusion. The first thing you need to know is the few areas of your system that are most likely to become cluttered so that you can begin to organize them in a targeted manner. In Windows, the areas that are usually more cluttered are:

*Desktop

*MyDocuments

*User’s folder on the system (X:DocumentsandSettingsXXX)

*Personal downloads directory (X. Downloads)

2Find and delete files you no longer need. After using a computer for a long time, there are a lot of files that you won’t use anymore, so delete the ones you’re sure you don’t use anymore.

3Store generic files in a large directory. For example, use My Documents, or create a new folder of your own, and put all similar files and folders in that one big folder. This makes it easier to back up and find.

4Create other directories to categorize your files. According to your own habits and requirements, create some meaningful directories, these directories are stored in the corresponding classification of files (folders). For example, you can in the disk root directory or a general folder, and then create “work”, “personal”, “friends”, “family “You can also create categories by date and time. You can also categorize by date and time, related people, activities, events, file types, locations, and so on. Just make the directory look more recognizable and easy for you to find.

5Create subdirectories to store files wisely. In a folder that has been categorized, if there are still a lot of files, try to create some subdirectories based on the attributes of the files, and then store the related files in the subdirectories separately. The problem with creating subdirectories is that you don’t want to create a deep directory structure, which will make it more difficult to find.

6 Sort the organized files. There are times when your file names can be meaningless names, for example, the names of songs you download from the Internet can sometimes be meaningless numbers. Reorganize the files in your folder by sorting and renaming them to make them look neater at a glance.

7 Organize your shortcuts. After using your computer for a long time, there will be a lot of messy shortcuts on your desktop, start menu, and quick start bar. You can’t possibly need all these shortcuts, right? In the “Quick Launch” bar, you only need to keep a few shortcuts that you use most often (e.g. internet, my documents, word, excel). Drag the rest of the shortcuts from the Start menu to the desktop, then create a new folder on the desktop to store all the shortcuts on the desktop. Open this folder, delete the unwanted shortcuts and keep only the frequently used ones. This way, your desktop and Start menu will look and feel fresher and more responsive.

8The most important point. When you download files or create new ones, don’t make it easy and put them all on the desktop. Make sure you put them all in folders that make sense so you can avoid clutter and keep your computer neat and organized.

Precautions

After you’ve done the above, you should perform a “disk defragmentation” because the indexes of the files will be changed while you’re defragmenting them, and the disk will generate a lot of fragmented files.

Use the Ctrl or Shift keys to easily select multiple files to delete and move.

If you use the Shift+Delete key combination, it will completely delete files without going to the Recycle Bin. If the Recycle Bin is full, deleting the file again will simply delete it.

If your Quick Launch bar is not in use, right-click on the taskbar and select Toolbars – Quick Launch in the menu. “in the menu.

You can open “All Programs” in the “Start” menu, right-click on the open Start menu, and in the pop-up menu, click “Sort by Name”. This will sort the shortcuts in the start menu.

To organize your desktop shortcuts, you can use Windows Desktop Cleanup to see which shortcuts are least used and then organize them.

After organizing your system, you can also take advantage of other system cleaners to remove junk files that are generated while your system is running, which will make your system run faster.