请输入您要查询的百科知识:

 

词条 sopen
释义

函数名: sopen

功 能: 打开一共享文件

用 法: int sopen(char *pathname, int access, int shflag, int permiss);

程序例:

#include <io.h>

#include <fcntl.h>

#include <sys\\stat.h>

#include <process.h>

#include <share.h>

#include <stdio.h>

int main(void)

{

int handle;

int status;

handle = sopen("c:\\\\autoexec.bat", O_RDONLY, SH_DENYNO, S_IREAD);

if (!handle)

{

printf("sopen failed\");

exit(1);

}

status = access("c:\\\\autoexec.bat", 6);

if (status == 0)

printf("read/write access allowed\");

else

printf("read/write access not allowed\");

close(handle);

return 0;

}

随便看

 

百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。

 

Copyright © 2004-2023 Cnenc.net All Rights Reserved
更新时间:2025/2/26 23:13:50