201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
|
/*
** Return the mode bits for a file. Return -1 if the file does not
** exist. If zFilename is NULL return the size of the most recently
** stat-ed file.
*/
int file_mode(const char *zFilename, int eFType){
return getStat(zFilename, eFType) ? -1 : fx.fileStat.st_mode;
}
/*
** Return TRUE if either of the following are true:
**
** (1) zFilename is an ordinary file
**
|
|
|
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
|
/*
** Return the mode bits for a file. Return -1 if the file does not
** exist. If zFilename is NULL return the size of the most recently
** stat-ed file.
*/
int file_mode(const char *zFilename, int eFType){
return getStat(zFilename, eFType) ? -1 : (int)(fx.fileStat.st_mode);
}
/*
** Return TRUE if either of the following are true:
**
** (1) zFilename is an ordinary file
**
|
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
|
void symlink_create(const char *zTargetFile, const char *zLinkFile){
#if !defined(_WIN32)
if( db_allow_symlinks() ){
int i, nName;
char *zName, zBuf[1000];
nName = strlen(zLinkFile);
if( nName>=sizeof(zBuf) ){
zName = mprintf("%s", zLinkFile);
}else{
zName = zBuf;
memcpy(zName, zLinkFile, nName+1);
}
nName = file_simplify_name(zName, nName, 0);
for(i=1; i<nName; i++){
|
|
|
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
|
void symlink_create(const char *zTargetFile, const char *zLinkFile){
#if !defined(_WIN32)
if( db_allow_symlinks() ){
int i, nName;
char *zName, zBuf[1000];
nName = strlen(zLinkFile);
if( nName>=(int)sizeof(zBuf) ){
zName = mprintf("%s", zLinkFile);
}else{
zName = zBuf;
memcpy(zName, zLinkFile, nName+1);
}
nName = file_simplify_name(zName, nName, 0);
for(i=1; i<nName; i++){
|