MCPcopy Create free account
hub / github.com/SmingHub/Sming / attach

Method attach

Sming/Core/Data/Stream/IFS/FileStream.cpp:15–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13namespace IFS
14{
15void FileStream::attach(FileHandle file, size_t size)
16{
17 close();
18 if(file < 0) {
19 return;
20 }
21
22 GET_FS()
23
24 handle = file;
25 this->size = size;
26 fs->lseek(handle, 0, SeekOrigin::Start);
27 pos = 0;
28
29 debug_d("attached file: '%s' (%u bytes) #0x%08X", fileName().c_str(), size, this);
30}
31
32bool FileStream::open(const String& fileName, OpenFlags openFlags)
33{

Callers

nothing calls this directly

Calls 2

lseekMethod · 0.80
c_strMethod · 0.45

Tested by

no test coverage detected