[Modules] Memory File System (all OS / DPI)

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

[Modules] Memory File System (all OS / DPI)

Post by Thorsten1867 »

MemoryFile - Module (all OS / 64Bit)

Based on an idea by srod & Kingwolf71, but their solution was far too complicated for me ;-)

Code: Select all

  ; MemFile::Create()   - comparable with CreateFile()
  ; MemFile::Open()     - comparable with OpenFile()
  ; MemFile::Close()    - reallocate memory with the actual size
  ; MemFile::Delete()   - comparable with DeleteFile()  
  ; MemFile::Free()     - removes the file and frees the memory 
  
  ; MemFile::Load()     - adds a file from HDD
  ; MemFile::Save()     - saves the file to HDD
  ; MemFile::Memory()   - adds a file from memory
  
  ; MemFile::Is()        - comparable with IsFile()
  ; MemFile::Size()      - comparable with FileSize()
  ; MemFile::Examine()   - comparable with ExamineDirectory()
  ; MemFile::NextEntry() - comparable with NextDirectoryEntry()
  ; MemFile::EntryID()   - returns the FileID => MemFile::Open()
  ; MemFile::EntryName() - comparable with DirectoryEntryName()
  ; MemFile::EntrySize() - comparable with DirectoryEntrySize()
  ; MemFile::Finish()    - comparable with FinishDirectory()
  
  ; MemFile::Loc()
  ; MemFile::FileSeek()
  ; MemFile::Lof()
  ; MemFile::Eof()
  
  ; MemFile::ReadStringFormat()
  ; MemFile::WriteStringFormat()
  
  ; MemFile::WriteAsciiCharacter()  
  ; MemFile::WriteByte()
  ; MemFile::WriteWord()
  ; MemFile::WriteUnicodeCharacter()
  ; MemFile::WriteLong()
  ; MemFile::WriteInteger()
  ; MemFile::WriteFloat()
  ; MemFile::WriteDouble()
  ; MemFile::WriteCharacter()
  ; MemFile::WriteString()
  ; MemFile::WriteStringN()
  
  ; MemFile::ReadAsciiCharacter()
  ; MemFile::ReadByte()
  ; MemFile::ReadUnicodeCharacter()
  ; MemFile::ReadWord()
  ; MemFile::ReadLong()
  ; MemFile::ReadInteger()
  ; MemFile::ReadFloat()
  ; MemFile::ReadDouble()
  ; MemFile::ReadCharacter()
  ; MemFile::ReadString()
    
  ; MemFile::Error()    - returns the last error

Download: MemoryFileModule.pbi
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
BarryG
Addict
Addict
Posts: 3292
Joined: Thu Apr 18, 2019 8:17 am

Re: [Modules] Memory File System (all OS / DPI)

Post by BarryG »

For "creating" files in memory, before writing them to disk? Also, the link doesn't open for me... Firefox and Edge both keep timing out when trying.
User avatar
Lord
Addict
Addict
Posts: 847
Joined: Tue May 26, 2009 2:11 pm

Re: [Modules] Memory File System (all OS / DPI)

Post by Lord »

Hi!

Both examples are missing the structure entry \EOF.
After adding this to MemFile_Structure both examples are complaining
that Entry() is not a Function, Array, Macro or LinkedList.

I stopped here.
Image
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Modules] Memory File System (all OS / DPI)

Post by Thorsten1867 »

Lord wrote: Fri Jun 24, 2022 7:48 am Hi!

Both examples are missing the structure entry \EOF.
After adding this to MemFile_Structure both examples are complaining
that Entry() is not a Function, Array, Macro or LinkedList.

I stopped here.
Fixed
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Post Reply