gpt4 book ai didi

android 是否可以写保护我使用 StorageAccessFramework 创建的纯文本文件?

转载 作者:行者123 更新时间:2023-11-29 18:25:45 26 4
gpt4 key购买 nike

我正在开发一个文本编辑器,希望能够对文件进行写保护。这可能吗?我可以使用游标和(COLUMN_FLAGS 和 FLAG_SUPPORTS_WRITE)从其 URI 获取其权限,但我找不到更改其权限的方法。

我还找到了一种使用 ParcelFileDescriptor 的 proc fd 获取 SD 卡上物理文件位置的方法,但 file.setWriteable(false, true) 不起作用。

谢谢
史蒂夫·S。

最佳答案

Is this possible?

不,对不起。

I can get its permissions from its URI using a cursor and (COLUMN_FLAGS and FLAG_SUPPORTS_WRITE) but I can't find a way to change its permissions.

这些并不是真正的“权限”。 FLAG_SUPPORTS_WRITE 仅表示内容是只读的。例如,the "Media" provider declares everything it serves as read-only .

I also figured out a way to get the physical file location on the SD card using the ParcelFileDescriptor's proc fd but file.setWriteable(false, true) doesn't work.

正确,不支持。

关于android 是否可以写保护我使用 StorageAccessFramework 创建的纯文本文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59129699/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com