Page 3 of 3 FirstFirst 123
Results 21 to 26 of 26

Thread: virtual file system in pascal/delphi

  1. #21

    virtual file system in pascal/delphi

    Nice you're interested in it, but please don't use it just now as it's really bad and needs to be fixed. It's released under BSD license.

  2. #22

    virtual file system in pascal/delphi

    Great I have no need to use it now, but perhaps later. I hope you can finish this project

    I see that with this technique you will be generating a lot of fragmentation, especially when using that to game development One wishlist for features would be defragment button, that completely rewrites the archive.
    Current projects with Delphi & Lazarus: Dage - Dog Adventure Game Engine.

  3. #23

    virtual file system in pascal/delphi

    So we have 2 vfs for delphi/fpc now? Nice

    I am currently waiting for feedback before making changes to it again. One planned feature is closing the archive file after a user is finished reading/writing and opening again when needed. Also my example should be updated to something nice looking as Brainer's. Now some featurs available are not visible.

    And yes defragmentation is an issue.
    http://3das.noeska.com - create adventure games without programming

  4. #24

    virtual file system in pascal/delphi

    @noeska: Yip, it seems like it's getting interesting now.

    @Rahakasvi: The idea of a VFS is to simulate a real hard disk, and AFAIK fragmentation cannot be avoided, so yes, sooner or later it'll be necessary to defragment your files. Defragmentation will be available in the new release of the VFS.

    The main design flaw of my VFS was that blocks information is stored in memory, so it's impossible to have huge drives. Now I'm working on a new design and a new file structure to make the VFS more flexible and faster. Also, I'd like to use that VFS for real data backups in the future, so I must make it reliable enough. I'll try to keep you posted - to anyone who's interested.

  5. #25

    virtual file system in pascal/delphi

    You read the complete archive in memory first? In my first version i also played with the idea of using a real record structure for an block and read that as a whole in memory but decided against it. Now if you need one byte from an file inside an archive only that byte is read not the complete block that the byte is stored in. The same goes for writing.

    Code:
    function TVirtualFileSystem.ReadBlock(ablockid: int64; var buffer; beginpos: integer; endpos: integer): int64;
    var
      nextblockid: int64;
    begin
      {$R+}
      FDataFile.Position :=(ablockid * FBlockSize); //goto begin of block
      FDataFile.ReadBuffer(nextblockid, sizeof(nextblockid));
    
      FDataFile.Position :=FDataFile.Position+beginpos; //advance to position within block
      FDataFile.ReadBuffer(buffer, (endpos-beginpos) ); //only read bytes needed
    
      result := nextblockid; //return the next block
    end;
    http://3das.noeska.com - create adventure games without programming

  6. #26

    virtual file system in pascal/delphi

    Nope, files aren't loaded into memory, only data about blocks (i.e. block's flag and size). And you can't have a High(Cardinal) of them when you store it in memory.

Page 3 of 3 FirstFirst 123

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •