空气:可能吗?写入已安装的应用程序包

发布于 2024-08-22 06:34:29 字数 149 浏览 2 评论 0原文

这可能是一个坏主意或者无论你不想怎么称呼它。尽管如此,我还是想知道 Air 是否可以在它自己安装的包中写入。我指的是在应用程序文件夹中发现大量的 OSX“.app”文件。由于其中每一个都可以作为常规文件夹打开,我猜它们就是这样。

我还错过了哪些其他奇特的文件写入技巧?

This is probably a bad idea or whatever you wan't to call it. Nevertheless, curious to know if Air can write inside it's own installed package. I'm referring to the OSX '.app' files found in great numbers in the applications folder. Since every one of these can be opened as a regular folder, i'm guessing that's what they are.

What other fancy filewriting tricks am i missing out on?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

世俗缘 2024-08-29 06:34:29

这绝对是个坏主意。也就是说,看起来这可能是可能的。类似于(未经测试):

var appDir:File = File.applicationDirectory; // uses app: URI, can't be written to
var appPath:String = appDir.nativePath;
var writeableAppDir:File = new File(appPath);

var newFile:File = writeableAppDir.resolvePath("writeme.txt");

nativePath< /code>applicationDirectory File 类中的 文档充满了对此的警告。跟着他们。

来自文档:

修改应用程序中的内容
目录是一个不好的做法,因为
安全原因。如果你想存储
应用程序特定的数据,考虑
使用应用程序存储
目录
(文件.应用程序存储目录)。如果
您想要其中的任何内容
应用程序存储目录有
访问应用程序特权
功能(AIR API),您可以
通过使用公开该功能
沙箱桥。

It's definitely a bad idea. That said, it looks like it's probably possible. Something like (untested):

var appDir:File = File.applicationDirectory; // uses app: URI, can't be written to
var appPath:String = appDir.nativePath;
var writeableAppDir:File = new File(appPath);

var newFile:File = writeableAppDir.resolvePath("writeme.txt");

The nativePath and applicationDirectory documentation in the File class are full of warnings against this. Follow them.

From the docs:

Modifying content in the application
directory is a bad practice, for
security reasons. If you want to store
application-specific data, consider
using the application storage
directory
(File.applicationStorageDirectory). If
you want any of the content in the
application storage directory to have
access to the application-priveleged
functionality (AIR APIs), you can
expose that functionality by using a
sandbox bridge.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文