tag:blogger.com,1999:blog-29331675.post115929636932594020..comments2024-03-05T17:37:00.995+01:00Comments on The Delphi Geek: GpStructuredStorage internalsgabr42http://www.blogger.com/profile/06903558857617342477noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-29331675.post-7216509534490073632010-07-28T10:10:03.809+02:002010-07-28T10:10:03.809+02:00a) All directories are infinitely extendable, even...a) All directories are infinitely extendable, even root.<br />b) A folder is just a file so a) applies.<br />c) See a).<br /><br />1 KB per 25 files was just an approximation. A file entry in the folder uses 14 bytes + length of the file name. If your files have 13-character names (all names are Unicode), 25 files would use 25 * (14 + 13*2) = 1000 bytes.gabr42https://www.blogger.com/profile/06903558857617342477noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-296491286223702932010-07-27T20:36:29.102+02:002010-07-27T20:36:29.102+02:00Are there any limitations on :
- number of files ...Are there any limitations on :<br /> - number of files in root?<br /> - number of folders in root?<br /> - number of files in subfolders?<br /><br />And, why did you mention "1 KB for each 25 files"?<br /><br />Thanks.Bryanhttps://www.blogger.com/profile/03439581705882937159noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-54216549886682424512010-07-27T20:13:06.498+02:002010-07-27T20:13:06.498+02:00Let's see ...
Header takes 1 KB. Always.
Ther...Let's see ...<br /><br />Header takes 1 KB. Always.<br />There is at least one FAT entry (1 KB) and it can address 256 x 1 KB blocks.<br />There is at least the root folder (1 KB).<br /><br />A back of the envelope calculation:<br />- Take your file sizes and round them up to the nearest 1 KB multiple.<br />- Multiply by 1.004 (FAT blocks).<br />- Add 1 KB for each 25 files (folder blocks).<br />- Add 3 KB (header, root FAT and root folder).gabr42https://www.blogger.com/profile/06903558857617342477noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-4475031547406649322010-07-27T18:21:33.258+02:002010-07-27T18:21:33.258+02:00How can I estimate the size of a new GpStructuredF...How can I estimate the size of a new GpStructuredFile BEFORE adding files to it?Bryanhttps://www.blogger.com/profile/03439581705882937159noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-33880111416741273972009-10-22T16:01:56.670+02:002009-10-22T16:01:56.670+02:00Store, yes. Execute, no.Store, yes. Execute, no.gabr42https://www.blogger.com/profile/06903558857617342477noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-89745309079181649292009-10-22T13:43:33.088+02:002009-10-22T13:43:33.088+02:00Hi;
Does it possible to store an executable file ...Hi;<br /><br />Does it possible to store an executable file (.exe) in this storage and <br />execute from there?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-29331675.post-34129669523517194472007-11-02T12:49:00.000+01:002007-11-02T12:49:00.000+01:00It turned out to be only a bug in the test suite.W...It turned out to be only a bug in the test suite.<BR/><BR/>When you passed a value larger than 63 as a fourth parameter to the TestFile method, TestFile made some incorrect assumptions and compared value that was larger than $FFFF to another value that was truncated to two bytes. As a result of that, error was raised (incorrectly).<BR/><BR/>I have updated test suite at http://gp.17slon.com/gp/files/testgpstructuredstorage_src.zip.gabr42https://www.blogger.com/profile/06903558857617342477noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-39330313933423717722007-11-02T11:39:00.000+01:002007-11-02T11:39:00.000+01:00I can confirm the problem. I'll fix it as soon as ...I can confirm the problem. I'll fix it as soon as I have a little spare time.<BR/><BR/>Thanks for reporting this!gabr42https://www.blogger.com/profile/06903558857617342477noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-34297671076479609202007-11-02T09:04:00.000+01:002007-11-02T09:04:00.000+01:00good work, but i find a bug.try to increase file s...good work, but i find a bug.<BR/><BR/>try to increase file size in test:<BR/><BR/>function TForm1.TestGSSBigAndSmall: boolean;<BR/>var<BR/> storage: IGpStructuredStorage;<BR/>begin<BR/> Result := false;<BR/> Log('Testing big and small files');<BR/> try<BR/> storage := CreateStructuredStorage;<BR/> storage.Initialize(CStorageFile, fmCreate);<BR/> // 0 bytes<BR/> TestFile(storage, '/small.dat', true, -1);<BR/> TestFile(storage, '/small2.dat', true, -1);<BR/> TestFile(storage, '/small2.dat', true);<BR/> // cross the 257-block boundary<BR/> TestFile(storage, '/large.dat', true, 64);<BR/> storage := CreateStructuredStorage;<BR/> storage.Initialize(CStorageFile, fmOpenRead);<BR/> TestFile(storage, '/small.dat', false, -1);<BR/> TestFile(storage, '/small2.dat', false);<BR/> TestFile(storage, '/large.dat', false, 64);<BR/> Result := true;<BR/> except<BR/> on E: Exception do<BR/> Log(' '+E.Message);<BR/> end;<BR/>end; { TForm1.TestGSSBigAndSmall }<BR/><BR/><BR/>Self test fail!<BR/>I use delphi 2007 Version 11.0.2804.9245<BR/>on XPUnknownhttps://www.blogger.com/profile/01008196071942907999noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-1159350143767868622006-09-27T11:42:00.000+02:002006-09-27T11:42:00.000+02:00Thanks for the thumbs up!(In hvala ;) )Thanks for the thumbs up!<BR/><BR/>(In hvala ;) )gabr42https://www.blogger.com/profile/06903558857617342477noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-1159349026056423542006-09-27T11:23:00.000+02:002006-09-27T11:23:00.000+02:00Brilliant. I found this in GExperts code and decid...Brilliant. I found this in GExperts code and decided to use it in a NewsReader program i'm writing. These posts will surely come in handy.<BR/><BR/>Hvala, pozdrav :)Anonymousnoreply@blogger.com