home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 31
/
CDASC_31_1996_juillet_aout.iso
/
internet
/
wsplug31.zip
/
TEST&RST.C
< prev
next >
Wrap
Text File
|
1996-02-06
|
691b
|
37 lines
#include <stdio.h>
#include <stdlib.h>
#include <io.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <sys\stat.h>
#include <share.h>
extern int errno;
main(argc,argv)
int argc;
char **argv;
{ int h,more=1 ;
if (argc < 2)
{ printf("test&rst filename\n");return(0);}
while(more)
{
h = sopen(argv[1],O_RDWR|O_CREAT|O_TRUNC,SH_DENYRW,S_IREAD|S_IWRITE) ;
if (h == -1)
{ if (errno != EACCES)
{ printf("Unable to Open %s...\n",argv[1]);
return(0) ;
}
else printf("Test&Rst, File %s Permision denied...\n",argv[1]);
}
else { printf("Reset %s\n",argv[1]);close(h) ;more=0;}
}
return(0);
}