[问题]第一次用netbeans不知道这是怎么回事?
-
- 帖子: 97
- 注册时间: 2006-09-28 15:18
-
- 帖子: 97
- 注册时间: 2006-09-28 15:18
怎么会下不了?挺多的,几个head文件,我只贴上main的吧
代码: 全选
/*ext2.c*/
/*���/
#include <stdio.h>
#include <time.h>
#include <string.h>
#include <signal.h>
#include "structure.h"
#include "login.h"
#include "alloc.h"
#include "format.h"
#include "dir.h"
#include "file.h"
int main(char argc,char **argv)
{
char command[10],temp[10];
char authority[1];
/*if(longin())
{
printf("System refused!\n");
return 1;
}*/
initialize_memory();
while(1)
{
printf("%s]#",current_path);
scanf("%s",command);
if(!strcmp(command,"cd"))
{
scanf("%s",temp);
cd(temp);
}
else if(!strcmp(command,"mkdir"))
{
scanf("%s",temp);
mkdir(temp,2);
}
else if(!strcmp(command,"mkf"))
{
scanf("%s",temp);
mkdir(temp,1);
}
else if(!strcmp(command,"rmdir"))
{
scanf("%s",temp);
rmdir(temp);
}
else if(!strcmp(command,"rm"))
{
scanf("%s",temp);
del(temp);
}
else if(!strcmp(command,"attrib"))
{
scanf("%s",authority);
scanf("%s",temp);
chmod(authority,temp);
}
else if(!strcmp(command,"open"))
{
scanf("%s",temp);
open_file(temp);
}
else if(!strcmp(command,"close"))
{
scanf("%s",temp);
close_file(temp);
}
else if(!strcmp(command,"read"))
{
scanf("%s",temp);
read_file(temp);
}
else if(!strcmp(command,"write"))
{
scanf("%s",temp);
write_file(temp);
}
else if(!strcmp(command,"ls"))ls();
else if(!strcmp(command,"format"))
{
char tempch;
printf("Format will erase all the data in the Disk\n");
printf("Are you sure?\n");
scanf(" %c",&tempch);
if(tempch=='Y'||tempch=='y')
{
fclose(fp);
initialize_disk();
}
else
printf("Format Disk canceled\n");
}
else if(!strcmp(command,"help"))help();
else if(!strcmp(command,"quit"))break;
else printf("No this Command,Please check!\n");
}
return 0;
}
- titainium
- 帖子: 689
- 注册时间: 2006-12-02 12:25
-
- 帖子: 97
- 注册时间: 2006-09-28 15:18