司机 售票员 进程同步 c语言,操作系统实验报告模板

memset(data,0,sizeof(data));//数据区

}

};

/*-----------------全局变量

--------------------------*/

FILE *fp; //磁盘文件地址

char * BaseAddr; //虚拟磁盘空间基地址string currentPath="C://"; //当前路径

int current=2; //当前目录的盘块号string cmd; //输入指令

struct DISK *osPoint; //磁盘操作系统指针

char command[16]; //文件名标识

struct OPENLIST* openlist; //用户文件列表指针

/*-----------函数事先申明--------------------*/ int mkdir(char *sonfname);

int create(char *name);

int listshow();

int delfile(char *name);

//int changePath(char *sonfname);

int write(char *name);

int exit();

int open(char *file);

int close(char *file);

int read(char *file);

/*------------初始化-----------------------*/

int format() {

current = 2;

currentPath="C://"; //当前路径

osPoint->format();//打开文件列表初始化

delete openlist;

openlist=new OPENLIST;

/*-------保存到磁盘上myfiles--------*/ fp = fopen(FilePath,"w+");

fwrite(BaseAddr,sizeof(char),DiskSize,fp);

fclose(fp);

printf("----------------------------------------------------------\n\n");

return 1;

}

/*-----------------------创建子目录

-------------------*/

int mkdir(char *sonfname)

{

//判断是否有重名

//寻找空白子目录项

//寻找空白盘块号

//当前目录下增加该子目录项

//分配子目录盘块,并且初始化

//修改fat表

int i,temp,iFAT;

struct dirFile *dir; //当前目录的指

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值