MCPcopy Create free account
hub / github.com/andysworkshop/stm32plus / openFile

Method openFile

lib/src/filesystem/fat/FatFileSystem.cpp:372–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370 */
371
372 bool FatFileSystem::openFile(const char *filename,File*& newFile) {
373
374 DirectoryEntryWithLocation dirent;
375
376 // tokenise the path
377
378 TokenisedPathname tp(filename);
379 if(tp.getNumTokens() == 0)
380 return errorProvider.set(ErrorProvider::ERROR_PROVIDER_FILESYSTEM,E_INVALID_PATHNAME);
381
382 // get the directory entry for this file
383
384 if(!getDirectoryEntry(tp,dirent))
385 return false;
386
387 // create the file object
388
389 newFile=new FatFile(*this,dirent);
390 return true;
391 }
392
393 /**
394 * Return true if directory has content (files or directories).

Callers 15

writeFileMethod · 0.45
verifyFileMethod · 0.45
readIndexFileMethod · 0.45
sendFileMethod · 0.45
processRequestMethod · 0.45
getErrorPageStreamMethod · 0.45
writeToFileMethod · 0.45
sendFileMethod · 0.45
downloadMethod · 0.45
uploadMethod · 0.45
readServerParametersMethod · 0.45
readImagesMethod · 0.45

Calls 2

getNumTokensMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected