Embed files into binary.

Pie? via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jun 5 23:45:19 PDT 2016


On Monday, 6 June 2016 at 06:10:35 UTC, rikki cattermole wrote:
> On 06/06/2016 6:06 PM, Pie? wrote:
>> On Monday, 6 June 2016 at 05:30:12 UTC, rikki cattermole wrote:
>>> On 06/06/2016 5:07 PM, Pie? wrote:
>>>> [...]
>>>
>>> Then I would say go get a new image library as that one isn't 
>>> a very
>>> good one.
>>>
>>> ..snip..
>>>
>>> Right got rid of all that text.
>>> If you want to make the filesystem appear to have files it 
>>> doesn't,
>>> you'll need a virtual file system library.
>>>
>>> Welcome to the next issue, getting libraries to support it ;)
>>
>> My point exactly! Glad you could finally support my 
>> conclusion! ;)
>
> Finally was many many months ago[0].
> I'm not happy with my implementation. Either way, somebody has 
> to go ahead and write one for Phobos. Although good luck with 
> getting that in.
>
> [0] 
> https://github.com/rikkimax/alphaPhobos/tree/master/source/std/experimental/vfs


Would this, say, allow an application to embed a "file system" 
into it's run time and then virtually dispatch file IO? If so, 
what about write access(the binary would grow in size when 
written to)?

What about seemlessly shifting between a real file system and the 
virtual one by simple flag toggling and rebuilding? If so, then D 
would definitely benefit from it.  This way one can create 
binaries and back them by a real file system for debugging 
purposes(easy access, no extracting from binaries or having to 
store them) then for release, one can turn that in to a virtual 
file system.

If this is what your vfs does or aims at then hats off! Cheerio! 
Where do I sign up? If not, would you mind expanding it to do 
such a thing?

I am essentially coding up something like that as we speak... 
Using static importing the binary and modulating all my file IO 
into a routine that chooses to use the physical file system when 
in debug mode and the imported data in release(it's quite easy, 
just dispatch to std.file io in debug and simply return the 
memory of the requested data in release).







More information about the Digitalmars-d-learn mailing list