Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mesmotronic/as3-worker-untar
ActionScript 3 Worker for extracting tar files in the background
https://github.com/mesmotronic/as3-worker-untar
Last synced: about 2 months ago
JSON representation
ActionScript 3 Worker for extracting tar files in the background
- Host: GitHub
- URL: https://github.com/mesmotronic/as3-worker-untar
- Owner: mesmotronic
- Created: 2014-01-24T08:14:01.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2019-04-23T16:19:16.000Z (over 5 years ago)
- Last Synced: 2024-08-29T02:02:17.398Z (5 months ago)
- Language: ActionScript
- Homepage:
- Size: 43.9 KB
- Stars: 11
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-actionscript-sorted - as3-worker-untar - ActionScript 3 Worker for extracting tar files in the background (Utilities / Asynchronous)
README
Untar Worker for Adobe AIR
==========================Untar Worker for Adobe AIR is an ActionScript 3 Worker class used to extract
uncompressed gnu-tar files, created using `tar -cf`, in the background.The Worker runs once, then self-terminates on completion.
Released under BSD license. Requires AIR 3.4+.
Example Project
---------------A simple Flex project for Adobe AIR example Flash Builder project is included in the examples folder, which enables you to select and extract a tar to a chosen folder.
Code Example
------------```as3
protected var untarWorker:Worker;
protected var resultChannel:MessageChannel;[Embed(source="UntarWorker.swf", mimeType="application/octet-stream")]
protected var untarWorkerClass:Class;protected function untar(sourcePath:String, targetPath:String):void
{
// giveAppPrivileges parameter MUST be set to true!
untarWorker = WorkerDomain.current.createWorker(new untarWorkerClass(), true);
untarWorker.addEventListener(Event.WORKER_STATE, untarWorker_workerState);
resultChannel = untarWorker.createMessageChannel(Worker.current);
resultChannel.addEventListener(Event.CHANNEL_MESSAGE, resultChannel_channelMessage);
untarWorker.setSharedProperty("sourcePath", sourcePath);
untarWorker.setSharedProperty("targetPath", targetPath);
untarWorker.setSharedProperty("resultChannel", resultChannel);
untarWorker.start();
}protected function untarWorker_workerState(event:Event):void
{
trace("untarWorker.state =", untarWorker.state);
}protected function resultChannel_channelMessage(event:Event):void
{
var success:Boolean = resultChannel.receive() as Boolean;
switch (success)
{
case true:
true("Success!");
break;
default:
trace("Error: are you sure that was a tar?");
break;
}
}
```Make a donation
---------------If you find this project useful, why not buy us a coffee (or as many as you think it's worth)?
[![Make a donation](https://www.paypalobjects.com/en_US/GB/i/btn/btn_donateCC_LG.gif)](http://bit.ly/2GBa6DY)