是否有用于从周围未压缩的 tar 文件中提取文件内容的 as3 解决方案?/乔纳斯
2 回答
试试hxformat,一个支持多种格式的 Haxe 库,包括tar
......你将需要Haxe,无论是使用swc 输出还是ActionScript 3 代......
一点旁注:就个人而言,我还是建议从 AS3 切换到 Haxe ... Haxe 也可以翻译成您正在使用的 PHP,因此您可以方便地在客户端和服务器上使用它...
编辑:是的,实际上 Haxe 可以直接编译为 swfs,从而产生比 as3 更快的字节码,但是如果你愿意的话,你总是可以使用 as3gen ... Haxe/PHP 也很酷,因为它会生成 php 代码,但是你可以使用 Haxe,这意味着它是严格类型的,并且整个 API 以一致且良好的 OO 方式公开...... Haxe 甚至不允许顶级函数......但如果你真的需要它来做一些肮脏的事情,你当然可以使用内联php ...
API 还包含许多有用的东西,作为用于干净和简单的数据库访问的SPOD 层(包 php.db)......本教程适用于 neko,但这并不重要,因为实际上是 Haxe/PHP 和 Haxe/Neko 标准API 是完全兼容的......这也意味着,从 php 移植到 neko(在某些情况下明显更快,更有效)通常是使用编译器指令重新映射包php
到包的问题neko
...... Haxe 是使用的解决方案PHP 的随处部署优势,同时使用了一种非常棒的语言......
此外,Haxe 比 AS3 和 PHP 更具表现力……它具有带有参数、泛型、结构子类型等的枚举……由于它与平台无关,因此存在一些缺点,但这些只会发生如果你的代码不是严格类型的......听起来像很多类型,但编译器推断出许多类型,所以通过初始化一个变量,它已经是严格类型的...... :)
哦,如果你真的想使用 Haxe,看看haxelib,它有很多很酷的库......
I haven't seen an as3 tar library. There are zip libraries out there though, like nochump's zip and fzip. A workaround would be to tell the server to make the requested tar into a zip, load into flash, and once you have the content, tell the server to whipe that zip. It's a big long and has unnecesary steps if you had a tar library for as3. The other option would be obviously to make your own tar library.
I have used nochump's zip and had no problems, but since you need no compression this would make the whole thing complex for no reason. How about not using any compression at all, and not package the whole thing into a tar. Try Bulk Loader:. Seems to fit your needs. If you don't feel like manually adding all the files manually you could probably generate an xml on the server, something generic like:
<files>
<file url="/images/icon.png" id="icon" />
...
</files>
Load that with an URLLoader, loop through the nodes, add the items to bulk loader and start the whole loading process.