Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Change the file_mkfolder() implementation to assume that the folder already exists and only go about creating it and its path if it does not previously exit. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
92ea61837e987614f65a5b0da27c54c8 |
| User & Date: | drh 2017-08-23 17:53:57.684 |
Context
|
2017-08-24
| ||
| 14:20 | Typo fixes thanks to rosscanning, ref [http://www.mail-archive.com/fossil-users@lists.fossil-scm.org/msg25775.html] check-in: f98852a0df user: andygoth tags: trunk | |
|
2017-08-23
| ||
| 18:53 | (cherry-pick): Remove a redundant directory separator character from the temporary filenames generated on windows. (cherry-pick): Change the file_mkfolder() implementation to assume that the folder already exists and only go about creating it and its path if it does not previously exit. check-in: adacbfbcfb user: jan.nijtmans tags: branch-2.3 | |
| 17:53 | Change the file_mkfolder() implementation to assume that the folder already exists and only go about creating it and its path if it does not previously exit. check-in: 92ea61837e user: drh tags: trunk | |
| 17:38 | Remove a redundant directory separator character from the temporary filenames generated on windows. check-in: b5f0d70362 user: drh tags: trunk | |
Changes
Changes to src/file.c.
| ︙ | ︙ | |||
630 631 632 633 634 635 636 |
int file_mkfolder(const char *zFilename, int forceFlag, int errorReturn){
int i, nName, rc = 0;
char *zName;
nName = strlen(zFilename);
zName = mprintf("%s", zFilename);
nName = file_simplify_name(zName, nName, 0);
| > | | | < < < < < < | | | < < < < | 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 |
int file_mkfolder(const char *zFilename, int forceFlag, int errorReturn){
int i, nName, rc = 0;
char *zName;
nName = strlen(zFilename);
zName = mprintf("%s", zFilename);
nName = file_simplify_name(zName, nName, 0);
while( nName>0 && zName[nName-1]!='/' ){ nName--; }
if( nName ){
zName[nName-1] = 0;
if( file_wd_isdir(zName)!=1 ){
rc = file_mkfolder(zName, forceFlag, errorReturn);
if( rc==0 ){
if( file_mkdir(zName, forceFlag) && file_wd_isdir(zName)!=1 ){
if( errorReturn <= 0 ){
fossil_fatal_recursive("unable to create directory %s", zName);
}
rc = errorReturn;
}
}
}
}
free(zName);
return rc;
}
/*
|
| ︙ | ︙ |