#包含?& ltsys/types . h & gt;
#包含?& ltsys/stat . h & gt;
#包含?& ltfcntl.h & gt
#包含?& ltstdio.h & gt
#包含?& ltstring.h & gt
(同Internationalorganizations)國際組織
主()
{
int?FD;
夏爾?*?p?=?“妳好”;
夏爾?buf[256]?=?{0};
如果?(-1?!=?(fd?=?打開(“。/new.txt ",O_RDWR)))
{
如果?(-1?!=?寫(fd,?p,?strlen(p))
{
printf("寫?OK \ n”);
}
其他
printf("寫?失敗\ n ");
關閉(FD);
}
如果?(-1?!=?(fd?=?打開(“。/new.txt ",O_RDONLY)))
{
如果?(-1?!=?閱讀(fd,?buf,?256))
printf("閱讀:?%s\n ",buf);
關閉(FD);
}
回歸?0;
}