android 是否可以对我使用 StorageAccessFramework 创建的 plain/text 文件进行写保护?
android is it possible to writeprotect a plain/text file I have created using the StorageAccessFramework?
我正在开发文本编辑器,希望能够对文件进行写保护。这可能吗?我可以使用游标和(COLUMN_FLAGS 和 FLAG_SUPPORTS_WRITE)从其 URI 获取其权限,但我找不到更改其权限的方法。
我还找到了一种使用 ParcelFileDescriptor 的 proc fd 获取 SD 卡上物理文件位置的方法,但是 file.setWriteable(false, true) 不起作用。
谢谢
Steve 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.
那些不是真的"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.
正确,不支持。
我正在开发文本编辑器,希望能够对文件进行写保护。这可能吗?我可以使用游标和(COLUMN_FLAGS 和 FLAG_SUPPORTS_WRITE)从其 URI 获取其权限,但我找不到更改其权限的方法。
我还找到了一种使用 ParcelFileDescriptor 的 proc fd 获取 SD 卡上物理文件位置的方法,但是 file.setWriteable(false, true) 不起作用。
谢谢
Steve 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.
那些不是真的"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.
正确,不支持。