39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
** Fill in the fileStat variable for the file named zFilename.
** If zFilename==0, then use the previous value of fileStat if
** there is a previous value.
**
** Return the number of errors. No error messages are generated.
*/
static int getStat(const char *zFilename){
if( zFilename==0 ){
if( fileStatValid==0 ) return 1;
}else{
if( stat(zFilename, &fileStat)!=0 ) return 1;
fileStatValid = 1;
}
return 0;
}
/*
** Return the size of a file in bytes. Return -1 if the file does not
** exist. If zFilename is NULL, return the size of the most recently
** stat-ed file.
|
>
|
|
>
>
>
|
>
|
>
|
|
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
** Fill in the fileStat variable for the file named zFilename.
** If zFilename==0, then use the previous value of fileStat if
** there is a previous value.
**
** Return the number of errors. No error messages are generated.
*/
static int getStat(const char *zFilename){
int rc = 0;
if( zFilename==0 ){
if( fileStatValid==0 ) rc = 1;
}else{
if( stat(zFilename, &fileStat)!=0 ){
fileStatValid = 0;
rc = 1;
}else{
fileStatValid = 1;
rc = 0;
}
}
return rc;
}
/*
** Return the size of a file in bytes. Return -1 if the file does not
** exist. If zFilename is NULL, return the size of the most recently
** stat-ed file.
|