289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
|
blob_appendf(pOut, "%//%/", zPwd, zOrigName);
}
blob_resize(pOut, file_simplify_name(blob_buffer(pOut), blob_size(pOut)));
}
/*
** COMMAND: test-canonical-name
**
** Test the operation of the canonical name generator.
*/
void cmd_test_canonical_name(void){
int i;
Blob x;
blob_zero(&x);
for(i=2; i<g.argc; i++){
file_canonical_name(g.argv[i], &x);
printf("%s\n", blob_buffer(&x));
blob_reset(&x);
}
}
/*
** Return TRUE if the given filename is canonical.
**
** Canonical names are full pathnames using "/" not "\" and which
|
>
>
>
|
>
>
>
>
>
|
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
|
blob_appendf(pOut, "%//%/", zPwd, zOrigName);
}
blob_resize(pOut, file_simplify_name(blob_buffer(pOut), blob_size(pOut)));
}
/*
** COMMAND: test-canonical-name
** Usage: %fossil test-canonical-name FILENAME...
**
** Test the operation of the canonical name generator.
** Also test Fossil's ability to measure attributes of a file.
*/
void cmd_test_canonical_name(void){
int i;
Blob x;
blob_zero(&x);
for(i=2; i<g.argc; i++){
const char *zName = g.argv[i];
file_canonical_name(zName, &x);
printf("%s\n", blob_buffer(&x));
blob_reset(&x);
printf(" file_size = %lld\n", file_size(zName));
printf(" file_mtime = %lld\n", file_mtime(zName));
printf(" file_isfile = %d\n", file_isfile(zName));
printf(" file_isexe = %d\n", file_isexe(zName));
printf(" file_isdir = %d\n", file_isdir(zName));
}
}
/*
** Return TRUE if the given filename is canonical.
**
** Canonical names are full pathnames using "/" not "\" and which
|