asar icon indicating copy to clipboard operation
asar copied to clipboard

Support for piped data

Open ghost opened this issue 10 years ago • 3 comments

I've been looking into ways of creating/streaming application updates (GitHub releases) for atom-shell apps and as asar is the only real option which isn't "send all the sourcecode" I was wondering if there's any support for piped data (e.g. converting a GitHub source zip into an asar file without unextracting it onto the disk?)

ghost avatar Feb 21 '15 22:02 ghost

I decided if I want a thing I should probably MAKE that thing so I've been trying to find ways of "piping" data to make asar files from memory (not something I've done before - not something I understand!!)

It's not easy because the existing code is heavily built around the idea of reading from disk but I have a hacked demo where I've modified how asar writes it's archives to support non-disk-based content

https://github.com/shrewdlogarithm/asar-pipe-test

That probably needs a bit of work (I've tested it with a few files and it's made valid asar files but there's no filesize validation, no UINT32/64 manipulation, no 'executable' support (do we really need that?) yet.

Just food-for-thought really - I have what I need to convert a tar.gz into an asar file without needing to write anything to disk (on a PAAS, you often don't have a disk to write to so this matters!)

ghost avatar Mar 02 '15 18:03 ghost

converting a GitHub source zip into an asar file without unextracting it onto the disk

ATM, this is hardly possible(still you can create some kind of virtual disk in memory end extract there), because asar packager "walks fs" to create archive header.

But I think if you can figure out directory structure in GitHub release archive, you should be able to construct a buffer according to asar format

YurySolovyov avatar May 11 '15 16:05 YurySolovyov

I stumbled upon a similiar problem when I tried to insert a vinyl file using gulp-asar. The process actually failed at gulp-asar (which uses asar/lib/filesystem) and not asar itself, but it looks like asar doesn't support this anyway.

It would be great if the asar API supported some virtuality to enable reading files or directory structures virtually defined in memory and also support writing its output to memory.

AlicanC avatar Aug 27 '15 13:08 AlicanC