MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / GetFileSize

Method GetFileSize

tensorflow/contrib/android/asset_manager_filesystem.cc:202–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200}
201
202Status AssetManagerFileSystem::GetFileSize(const string& fname, uint64* s) {
203 // If fname corresponds to a directory, return early. It doesn't map to an
204 // AAsset, and would otherwise return NotFound.
205 if (DirectoryExists(fname)) {
206 *s = 0;
207 return Status::OK();
208 }
209 string path = RemoveAssetPrefix(fname);
210 auto asset = ScopedAsset(
211 AAssetManager_open(asset_manager_, path.c_str(), AASSET_MODE_RANDOM));
212 if (asset.get() == nullptr) {
213 return errors::NotFound("File ", fname, " not found.");
214 }
215 *s = AAsset_getLength64(asset.get());
216 return Status::OK();
217}
218
219Status AssetManagerFileSystem::Stat(const string& fname, FileStatistics* stat) {
220 uint64 size;

Callers

nothing calls this directly

Calls 4

ScopedAssetClass · 0.85
NotFoundFunction · 0.85
c_strMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected