17 lines
278 B
C
17 lines
278 B
C
#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 );
|
|
}
|
|
}
|