File System
gkScript main object
The global gkScript object offers the following filesystem functions:
Directory Content
gkScript::listDirectory(string path)
Returns an array of DirecotyEntry objects
DirectoryEntry:
listDirectory sample:
Ranged read/write operations
gkScript::loadFile(path, content, offset, size)
Can be used to load a part of a file
gkScript::getFileInformation(path, &info)
Can be used to retrieve the file size
gkScript::saveFile(path, content, offset)
Can be used to write a part of the file. The write size is the size of the content string.
File summary
gkScript::getFileSummary(string path)
Returns a map of key:value pairs with summary information about the file. Supported file types are: - Structured storage file with summary information (.msi, .msg, .doc, .xls, thumps.db,...) - PST files
Dump MSI installer cache:
Read console input
string gkScript::readStdin()
Reads from stdin until end of file is reached
Console input sample:
Read console input
gkScript::addNetworkConnection(path, user, password, localDrive)
Creates a network connection. If user and password are empty, the current user context is used to connect. If localDrive is present, the connection is permanent and mapped to the drive. Use the format "X:" for localDrive.
gkScript::deleteNetworkConnection(path, force)
Removes a network connection. Path can be eithe a UNC path or a local drive.
Last updated