FileSystemFlags.exclusive - Web APIs 编辑

Experimental

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The exclusive property on the FileSystemFlags dictionary is used in tandem with the create property to determine whether or not it's acceptable to require that the file not already exist when the reference to it is created by calling FileSystemDirectoryEntry.getFile() or FileSystemDirectoryEntry.getDirectory().

Syntax

fileSystemFlags.exclusive = booleanValue

Values

The table below describes the result of each possible combination of these flags depending on whether or not the target file or directory path already exists.

Option valuesFile/directory conditionResult
createexclusive
falsen/a[1]Path exists and matches the desired type (depending on whether the function called is getFile() or getDirectory()The successCallback is called with a FileSystemFileEntry if getFile() was called or a FileSystemDirectoryEntry if getDirectory() was called.
falsen/a[1]Path exists but doesn't match the desired typeThe errorCallback is called with an appropriate error code (if the callback was provided).
truefalsePath existsThe existing file or directory is removed and replaced with a new one, then the successCallback is called with a FileSystemFileEntry or a FileSystemDirectoryEntry, as appropriate.
truefalsePath doesn't existThe file or directory is created, then a FileSystemFileEntry or a FileSystemDirectoryEntry is passed to the successCallback, as appropriate.
truetruePath existsThe errorCallback is called with an appropriate error, such as FileError.PATH_EXISTS_ERR.
truetruePath doesn't existThe file or directory is created, then a FileSystemFileEntry or a FileSystemDirectoryEntry is passed to the successCallback, as appropriate.

[1] When create is false, the value of exclusive is irrelevant and ignored.

Specifications

SpecificationStatusComment
File and Directory Entries API
The definition of 'FileSystemFlags' in that specification.
DraftInitial specification.

Browser compatibility

BCD tables only load in the browser

See also

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:40 次

字数:5882

最后编辑:7年前

编辑次数:0 次

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