Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

writefile 写多个磁盘块参数错误 #3

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added .vscode/temp.sql
Empty file.
4 changes: 3 additions & 1 deletion MingOS.h
Original file line number Diff line number Diff line change
Expand Up @@ -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" //��������ļ���

Expand Down
5 changes: 3 additions & 2 deletions os_funs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,7 @@ using namespace std;
//�ҵ�һ�����м�¼�������ļ����������λ��
posi = dno;
posj = j;
break;
}
else if(strcmp(dirlist[j].itemName,name)==0 ){
//������ȡ��inode���ж��Ƿ����ļ�
Expand Down Expand Up @@ -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);
}


Expand Down Expand Up @@ -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);
}
//���¸��ļ���С
Expand Down