Lines Matching defs:filename
53 static int OpenAndReadMagic(const char* filename, uint32_t* magic, std::string* error_msg) {
55 ScopedFd fd(open(filename, O_RDONLY, 0));
57 *error_msg = StringPrintf("Unable to open '%s' : %s", filename, strerror(errno));
62 *error_msg = StringPrintf("Failed to find magic in '%s'", filename);
66 *error_msg = StringPrintf("Failed to seek to beginning of file '%s' : %s", filename,
73 bool DexFile::GetChecksum(const char* filename, uint32_t* checksum, std::string* error_msg) {
79 const char* file_part = filename;
82 if (DexFile::IsMultiDexLocation(filename)) {
83 file_part_storage = GetBaseLocation(filename);
85 zip_entry_name = filename + file_part_storage.size() + 1;
95 std::unique_ptr<ZipArchive> zip_archive(ZipArchive::OpenFromFd(fd.release(), filename, error_msg));
110 std::unique_ptr<const DexFile> dex_file(DexFile::OpenFile(fd.release(), filename, false, error_msg));
117 *error_msg = StringPrintf("Expected valid zip or dex file: '%s'", filename);
121 bool DexFile::Open(const char* filename, const char* location, std::string* error_msg,
124 ScopedFd fd(OpenAndReadMagic(filename, &magic, error_msg));
142 *error_msg = StringPrintf("Expected valid zip or dex file: '%s'", filename);