/* * Copyright 2006 The Android Open Source Project * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file.
*/
size_t sk_ftell(FILE* f) { long curr = ftell(f); if (curr < 0) { return 0;
} return curr;
}
void sk_fclose(FILE* f) { if (f) {
fclose(f);
}
}
bool sk_isdir(constchar *path) { struct stat status = {}; if (stat(path, &status) == 0) { return SkToBool(status.st_mode & S_IFDIR);
} #ifdef SK_BUILD_FOR_IOS // check the bundle directory if not in default path
SkString bundlePath; if (!ios_get_path_in_bundle(path, &bundlePath)) { returnfalse;
} if (stat(bundlePath.c_str(), &status) == 0) { return SkToBool(status.st_mode & S_IFDIR);
} #endif returnfalse;
}
bool sk_mkdir(constchar* path) { if (sk_isdir(path)) { returntrue;
} if (sk_exists(path)) {
fprintf(stderr, "sk_mkdir: path '%s' already exists but is not a directory\n",
path); returnfalse;
}
int retval; #ifdef _WIN32
retval = _mkdir(path); #else
retval = mkdir(path, 0777); if (retval) {
perror("mkdir() failed with error: ");
} #endif return 0 == retval;
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.2 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.