diff --git a/.vscode/temp.sql b/.vscode/temp.sql new file mode 100644 index 0000000..e69de29 diff --git a/MingOS.h b/MingOS.h index 0c8e486..be50105 100644 --- a/MingOS.h +++ b/MingOS.h @@ -25,8 +25,10 @@ #define OTHERS_R 4 //�����û���Ȩ�� #define OTHERS_W 2 //�����û�дȨ�� #define OTHERS_X 1 //�����û�ִ��Ȩ�� + +// ע umask Ĭ��Ϊ002������ļ�Ĭ��Ȩ�� 664��Ŀ¼Ĭ��Ȩ��775 #define FILE_DEF_PERMISSION 0664 //�ļ�Ĭ��Ȩ�� -#define DIR_DEF_PERMISSION 0755 //Ŀ¼Ĭ��Ȩ�� +#define DIR_DEF_PERMISSION 0775 //Ŀ¼Ĭ��Ȩ�� #define FILESYSNAME "MingOS.sys" //��������ļ��� diff --git a/os_funs.cpp b/os_funs.cpp index 8b531f2..07ae208 100644 --- a/os_funs.cpp +++ b/os_funs.cpp @@ -761,6 +761,7 @@ using namespace std; //�ҵ�һ�����м�¼�������ļ����������λ�� posi = dno; posj = j; + break; } else if(strcmp(dirlist[j].itemName,name)==0 ){ //������ȡ��inode���ж��Ƿ����ļ� @@ -816,7 +817,7 @@ using namespace std; p.i_dirBlock[k/superblock->s_BLOCK_SIZE] = curblockAddr; //д�뵽��ǰĿ¼�Ĵ��̿� fseek(fw,curblockAddr,SEEK_SET); - fwrite(buf+k,superblock->s_BLOCK_SIZE,1,fw); + fwrite(buf+k*superblock->s_BLOCK_SIZE,superblock->s_BLOCK_SIZE,1,fw); } @@ -1625,7 +1626,7 @@ using namespace std; } //д�뵽��ǰĿ¼�Ĵ��̿� fseek(fw,curblockAddr,SEEK_SET); - fwrite(buf+k,superblock->s_BLOCK_SIZE,1,fw); + fwrite(buf+k*superblock->s_BLOCK_SIZE,superblock->s_BLOCK_SIZE,1,fw); fflush(fw); } //���¸��ļ���С