Skip to content

Commit 682eee7

Browse files
committed
文件/文件夹判断输出消歧义
1 parent 8e3611d commit 682eee7

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

delete.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ void delete(char *filename){
1212
}
1313
inode = iget(dir.direct[dirid].d_ino);
1414
if(!(inode->di_mode &DIFILE)){
15-
printf("对象不是文件,请检查!\n");
15+
printf("已有对象类型不是文件,请检查!\n");
1616
iput(inode);
1717
return;
1818
}

dir.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void mkdir(char *dirname){
5050
if (inode->di_mode & DIDIR)
5151
printf("目录%s已存在!\n", dirname); //xiao
5252
else
53-
printf("%s是一个文件\n", dirname);
53+
printf("已有%s的类型不是目录\n", dirname);
5454
iput(inode);
5555
return;
5656
}
@@ -92,7 +92,7 @@ void chdir(char *dirname){
9292
}
9393
inode =iget(dir.direct[dirid].d_ino);
9494
if(!(inode->di_mode&DIDIR)){
95-
printf("%s不是一个目录\n", dirname);
95+
printf("%s的类型不是目录\n", dirname);
9696
return;
9797
}
9898
for (i=0; i<dir.size; i++){

open.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ short open(int user_id, char *filename,char openmode){
1313
}
1414
inode = iget(dir.direct[dinodeid].d_ino);
1515
if (!(inode->di_mode &DIFILE)){
16-
printf("\n%s is not a file!!!\n",filename);
16+
printf("\nType of the existent %s is not a file!!!\n",filename);
1717
iput(inode);
1818
return -1;
1919
}

0 commit comments

Comments
 (0)