| 13 | namespace IFS |
| 14 | { |
| 15 | void 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 | |
| 32 | bool FileStream::open(const String& fileName, OpenFlags openFlags) |
| 33 | { |