非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。
truncate
method is used to remove some data within the file.
If the method is called with no argument, the operation removes all the bytes starting at the index set in
LockedFile.location
.
If the method is called with an argument, the operation removes all the bytes starting at the index corresponding to the parameter and regardless of the value of
LockedFile.location
.
var request = instanceOfLockedFile.truncate(start);
start
可选
A number representing the index where to start the operation.
A
FileRequest
object to handle the success or failure of the operation.
| 规范 | 状态 | 注释 |
|---|---|---|
| FileSystem API | 编者草案 | Draft proposal |
LockedFile
FileError
FileException
FileHandle
FileRequest
FileSystem
FileSystemDirectoryEntry
FileSystemDirectoryEntrySync
FileSystemDirectoryReader
FileSystemDirectoryReaderSync
FileSystemEntry
FileSystemEntrySync
FileSystemFileEntry
FileSystemFileEntrySync
FileSystemFlags
FileSystemSync
HTMLInputElement
LocalFileSystem
LocalFileSystemSync
元数据
Window.requestFileSystem()
Window.resolveLocalFileSystemURL()
WorkerGlobalScope.requestFileSystemSync()