mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-12 15:52:52 +00:00
Scripts: File and Folder exists checks the kind, encode keeps slashes, every call is counted
- `File.encode` and `Folder.encode` leave `/` unescaped, as the File object reference lists it among the characters kept (https://extendscript.docsforadobe.dev/file-system-access/file-object/). - `exists` is true for a `File` only when the path names something other than a folder, and for a `Folder` only when it names a folder. - Fields of the records the app returns are read as own properties, so a property a script puts on `Object.prototype` does not turn a successful `open` into a failure. - `File.encode`, `File.decode`, `File.isEncodingAvailable` and the `Folder` locations count as file calls and charge the host-call limit. - On the web the locations are `null` and `File.tempName` names a file at the root, without asking the platform for a temporary folder.
This commit is contained in:
@@ -1819,6 +1819,8 @@ script reads files with them:
|
||||
objects for the same path are different objects.
|
||||
- `name`, `displayName`, `fsName`, `absoluteURI`, `fullName`, `relativeURI`, `path`, `parent` and `toString()` come
|
||||
from the path. `exists`, `length`, `created`, `modified`, `hidden`, `readonly` and `alias` read the file system.
|
||||
`exists` is true for a `File` only when the path names something other than a folder, and for a `Folder` only
|
||||
when it names a folder.
|
||||
`File.encode`, `File.decode` and `File.isEncodingAvailable` (and the same on `Folder`), `File.fs`, and the folders
|
||||
`Folder.temp`, `Folder.desktop`, `Folder.myDocuments`, `Folder.userData` and the others are there too.
|
||||
- `open('r')` opens a file to read, and `read([chars])`, `readln()`, `readch()`, `seek(pos[, mode])`, `tell()`, `eof`
|
||||
|
||||
Reference in New Issue
Block a user