非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。
只读
modificationTime
特性为
元数据
接口是
日期
object which specifies the date and time the file system entry (or the data referenced by the entry) was last modified.
A file system entry is considered to have been modified if the metadata or the contents of the referenced file (or directory, or whatever other kind of file system entry might exist on the platform in use) has changed.
var modificationTime = Metadata.modificationTime;
A
日期
timestamp indicating when the file system entry was last changed.
This example tries to get a particular working file at
tmp/workfile.json
. Once that file has been found, its metadata is obtained and the file's modification timestamp year is compared to the current year. If it was last modified in a year at least five prior to the current year, the file is removed and a new one is created.
workingDirectory.getFile("tmp/workfile.json", { create: true }, function(fileEntry) {
fileEntry.getMetadata(function(metadata) {
if ((new Date().getFullYear() - metadata.modificationTime.getFullYear()) >= 5) {
fileEntry.remove(function() {
workingDirectory.getFile("tmp/workfile.json", { create: true }, function(newEntry) {
fileEntry = newEntry;
});
});
}
});
}, handleError);
此 API 没有正式的 W3C 或 WHATWG (Web 超文本应用程序技术工作组) 规范。
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
modificationTime
非标
|
Chrome 13 | Edge ≤79 | Firefox No | IE No | Opera No | Safari No | WebView Android No | Chrome Android Yes | Firefox Android No | Opera Android No | Safari iOS No | Samsung Internet Android Yes |
完整支持
不支持
实验。期望将来行为有所改变。
非标。预期跨浏览器支持较差。
元数据
modificationTime
size
FileError
FileException
FileHandle
FileRequest
FileSystem
FileSystemDirectoryEntry
FileSystemDirectoryEntrySync
FileSystemDirectoryReader
FileSystemDirectoryReaderSync
FileSystemEntry
FileSystemEntrySync
FileSystemFileEntry
FileSystemFileEntrySync
FileSystemFlags
FileSystemSync
HTMLInputElement
LocalFileSystem
LocalFileSystemSync
LockedFile
Window.requestFileSystem()
Window.resolveLocalFileSystemURL()
WorkerGlobalScope.requestFileSystemSync()