This repository has been archived on 2024-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
CodeBlocksPortable/WATCOM/samples/clibexam/_fsopen.c

17 lines
278 B
C
Raw Normal View History

#include <stdio.h>
#include <share.h>
void main()
{
FILE *fp;
/*
open a file and prevent others from writing to it
*/
fp = _fsopen( "report.dat", "w", SH_DENYWR );
if( fp != NULL ) {
/* rest of code goes here */
fclose( fp );
}
}