FreeBASIC
0.91.0
Main Page
Data Structures
Files
File List
Globals
file_kill.c
Go to the documentation of this file.
1
/* kill function */
2
3
#include "
fb.h
"
4
#include <errno.h>
5
6
/*:::::*/
7
FBCALL
int
fb_FileKill
(
FBSTRING
*str )
8
{
9
int
res = 0, err = 0;
10
11
if
( str->
data
!=
NULL
)
12
{
13
res =
remove
( str->
data
);
14
err = errno;
15
}
16
17
/* del if temp */
18
fb_hStrDelTemp
( str );
19
20
if
( res == 0 )
21
{
22
res =
FB_RTERROR_OK
;
23
}
24
else
25
{
26
switch
(err)
27
{
28
case
ENOENT:
29
res =
FB_RTERROR_FILENOTFOUND
;
30
break
;
31
case
EACCES:
32
res =
FB_RTERROR_FILEIO
;
33
break
;
34
case
EPERM:
35
res =
FB_RTERROR_NOPRIVILEDGES
;
36
break
;
37
default
:
38
res =
FB_RTERROR_ILLEGALFUNCTIONCALL
;
39
break
;
40
}
41
}
42
43
return
fb_ErrorSetNum
( res );
44
}
rtlib
file_kill.c
Generated on Thu Jan 23 2014 19:40:11 for FreeBASIC by
1.8.4