Onetastic Macro Documentation >
>
Accessing the file system Accessing the File System
Onetastic Macros can access the file system on the local computer using
.
File and Folder objects
File and Folder objects represent files and folders on local disk.
They may point to files and folders that exist or ones that don't exist yet. They
provide basic information about the files and folders like their names and full paths.
You can obtain these objects from file pickers or certain File System functions. They
can be passed to most other File System functions to get more information about the
files and folders or read from and write to files.
Checking existance of files and folders
You can check if a file or folder exists using the following functions:
Asking user to pick files and folders
Following functions can be used to ask user to pick files to read or write, or pick folders:
Creating and deleting files and folders
To create folders, use the FileSystem_CreateFolder function. To create files,
use the FileSystem_WriteToFile function. Files and folders can be deleted
using the following two functions:
Reading and writing files
To read contents of existing files and write data to files on disk, use the following functions:
Enumerating contents of a folder and known folders
You can enumerate the contents of a folder using FileSystem_GetFolderEntries. It can either
provide you all files and subfolders of a folder, or you can filter to specific extensions.
You can also get access to specific known folders like user's Desktop or Documents using the
FileSystem_GetKnownFolder function.
Obtaining the size of a file
FileSystem_GetFileSize function can be used to obtain the size of an existing file on disk.
|