📄 load.c
字号:
#include <stdio.h>
#include <string.h>
#include "filesys.h"
load()
{
char* m;
char l;
struct inode *pinode;
struct inode *p1;
char* buff;
int pos;
int middle;
super= (struct filesys* )malloc(sizeof(struct filesys));
fd=fopen("filesystem","r+");
if(buff ==NULL)
{
printf("\n file system file creat failed!!!\n");
}
else
{
fseek(fd,0,SEEK_SET);
fread(super,sizeof(struct filesys),1,fd);
fseek(fd,BLOCKSIZE,SEEK_SET);
fread(block_buf,sizeof(char),BLOCKNUM,fd);
fseek(fd,2*BLOCKSIZE,SEEK_SET);
fread(inode_buf,sizeof(char),BLOCKNUM,fd);
super->s_free=block_buf;
super->s_inode=inode_buf;
readdir1();
}
//fclose(fd);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -