Exemplo n.º 1
0
// Disabled temporarily - pcsl_file_exist does not distinguish between
// directory and "file".
bool OsFile_exists(const JvmPathChar *filename) {
  int name_len = fn_strlen(filename);
  pcsl_string pcsl_filename = PCSL_STRING_NULL;

  GUARANTEE(sizeof(jchar) == sizeof(JvmPathChar), "Types must match");

  if (pcsl_string_convert_from_utf16(filename, 
                                     name_len, 
                                     &pcsl_filename) != PCSL_STRING_OK) {
    return false;
  }

  jboolean result = pcsl_file_exist(&pcsl_filename);
  pcsl_string_free(&pcsl_filename);

  return result;
}
Exemplo n.º 2
0
/*
 * Return a non-zero integer if a file with the given name exists else return
 * zero.
 */
int
storage_file_exists(const pcsl_string* filename_str) {
    /* Mapping 0 and -1 (error) to 0 (file not exists). */
    return pcsl_file_exist(filename_str) > 0;
}