Skip to content

Document

Document · Type

NameTypeDescription
basenamestringThe last part of the path.
bytesCollectionThe contents one byte at a time, read as you go.
childrenFile[]The same as contents. Null for a file that is not an archive.
contentsFile[]For an archive such as a zip, what is inside it.
cursorintHow far through the contents the reading has got, in bytes.
deletedboolTrue when it has been deleted.
direct_uristringA link to download straight from the storage, when the share allows it.
dirnamestringThe path of the folder that holds it.
display_namestringThe name without its extension.
endboolTrue once everything has been read.
eventsboolWhether changes made through this file raise Foldr events. Assign false to stop them.
extensionstringThe extension without the dot, or an empty string.
google_export_extensionstringThe extension a Google file exports to.
google_export_mimetypestringThe MIME type a Google file exports to.
hashstringThe SHA-256 of the contents. Call hash(algo) for another algorithm.
hiddenboolTrue when the storage marks it hidden.
is_dirboolTrue for a folder, false for a file.
is_google_docboolTrue for a Google Docs, Sheets or Slides file.
is_movedboolTrue when this event moved or renamed it.
is_newboolTrue when this event created it.
is_updatedboolTrue when this event changed it.
linestringThe next line of a text file. Each read moves on.
linesCollectionThe lines of a text file, read as you go.
mimetypestringThe MIME type, such as application/pdf. A folder has none.
modifiedDateWhen it was last changed. Assigning a date sets it on storage that allows that.
namestringThe name with its extension. Assigning a new string renames the file or folder.
nice_pathstringThe path as people see it in Foldr. It differs from path only on storage whose own paths are not readable (an id-based store, say).
nice_uristringThe same address built from nice_path.
parentFolderThe folder that holds it, or null at the top of the share.
pathstringThe path inside the share.
search_uristringThe address search knows it by.
shareShareThe share it lives on.
sizeintThe size in bytes. A folder is 0.
streamstreamAn open read stream of the contents.
uristringThe share and the path together, as one address.
userUserThe account it was opened as.
vendor_idstringThe id the storage gives it (Google Drive, OneDrive, Box and similar), when it has one.
versionsarrayThe earlier versions, on storage that keeps them.
document.childrenComplete() → bool

No description yet.

document.close()

No description yet.

document.delete()

No description yet.

document.duplicate(destination?: File, sourceVersion?: string)

No description yet.

document.export()

No description yet.

document.getContents()

No description yet.

document.getName() → string

No description yet.

document.getParent() → File

No description yet.

document.getPath() → string

No description yet.

document.getSeekableStream()

A fresh stream that can really seek; see FileStreamHandler::getSeekableStream().

document.getShare() → Share

No description yet.

document.getStream()

No description yet.

document.getUser() → User

No description yet.

document.hasStatus(status: FileStatus) → bool

No description yet.

document.hash(algo?: string = "sha256") → string

No description yet.

document.in(folders?: File) → bool

No description yet.

document.is(file: File) → bool

No description yet.

document.isDeleted() → bool

No description yet.

document.isDir() → bool

No description yet.

document.isMoved() → bool

No description yet.

document.isNew() → bool

No description yet.

document.isUpdated() → bool

No description yet.

document.isZip() → bool

Checks if the file is a ZIP archive based on its mimetype.

document.listVersions() → array

No description yet.

document.make(path: Stringable, asDir?: bool = false, suggest?: bool = false, force?: bool = false) → File

No description yet.

document.move(destination: Folder, suggest?: bool = false) → bool

No description yet.

document.read(length?: int)

No description yet.

document.readLine()

No description yet.

document.refresh()

No description yet.

document.release()

No description yet.

document.rename(newName: string) → bool

No description yet.

document.reserve(ttl?: mixed = 10)

No description yet.

document.rewind() → bool

No description yet.

document.seek(offset: int) → int

No description yet.

document.setUser(user?: mixed)

The user this file is opened as: what sharing, permissions and activity act as. Takes a user, a MaSH user (file.setUser(owner)) or a GUID; null clears it. A script giving an event file a user so it can share it is the case this is called from MaSH for.

document.tell()

No description yet.

document.triggerEvents()

No description yet.

document.version(versionId: string)

No description yet.

document.write(args?: mixed) → Document

No description yet.