GoFiler Legato Script Reference
Legato v 1.5b Application v 5.24b
|
Table of Contents | < < Previous | Next >> |
Chapter Six — File Functions (continued)
6.4 File String and Path Functions
This section covers string functions specifically designed for files, folders and URI processing.
Since Legato runs in a windows environment, it accepts both forward and back slashes as path delimiters. When working with URIs all slashes should be forward slashes. Many functions have internal limits on path sizes of MAP_PATH_SIZE or 512 bytes. Note that many Windows functions are limited to a maximum path size of 266 characters.
Unless otherwise specified, file string functions do not support UNICODE.
Throughout the documentation, folder, directory and path are used. Folder and directory are essentially the same, a folder containing a series of files and other folders, and a directory contains a list of files and folders in a folder. A path can specify all or part of a location.
A fully qualified path simply means that the string specifies a unique unambiguous location from the script’s perspective. For example, “C:\Windows\”. A relative path means that it must be combined with a base to become a fully qualified path. For example, “Windows\”.
A path can contain a drive letter as a fixed device such as a hard drive or SD card or a mapped network drive. Other methods of identifying network and other devices is a UNC or Universal Naming Convention. In all cases, drives, folders or files are referenced. In the case of web servers, a URL or Uniform Resource Locator references a number of items such as files servers, streams, and various protocols.
By convention, Windows paths use a backslash delimiter and non-Windows a forward slash delimiter. In later versions Windows, the slashes can be used universally to reference files. However, there are certain functions and support routines that will not accept forward slashes such as Windows Explorer which can impact the BrowseFolder, BrowseOpenFile, BrowseOpenFiles and BrowseSaveFile functions.
Assembling Paths, UNCs and URLs:
AddPathDelimiter — Appends an appropriate path delimiter, if required.
AddPaths — Adds to paths by taking into account limb connectors (i.e., ..).
ApplyDefaultPath — Applies/qualifies path of target with a base if the target is not qualified.
CatPaths — Concatenates paths (simple appends and removes extra // characters).
CreateRelativePath — Combines a base and target path to create a relative path.
ExpandEnvironmentalStrings — Expands strings containing environmental variable names.
MakePathRelative — Makes target a relative path (if possible) based on provided path.
PathLevelUp — Cuts path one level up.
PathToMSDelimiters — Changes all slashes to backslashes.
PathToURIDelimiters — Changes all backslashes to slashes.
QualifyURL — Qualifies target using a base path.
Parsing Paths, UNCs, URLs:
ClipFileExtension — Clips the file extension from a filename or path.
ClipIDReference — Clips off an ID reference such as #name.
ClipQueryOrID — Clips off either query or named ID.
ClipURIAuthority — Clips off URI/URL authority, if present.
ClipURIFilename — Removes the filename query or ID from a URI. This routine assumes that a path after the authority ends at the section with an extension, query or named position.
ClipURIPath — Removes all text after the domain/authority.
CollapsePath — Collapses path (removes middle) to limit size for display.
DecodeURI — Decodes a complete URL or part of a URI.
EncodeURIComponent — Encodes URI components (URN sections).
GetAdjustURLFilename — Gets the filename from URL.
GetDrive — Gets the drive letter (as upper case).
GetExtension — Gets the file extension with leading period.
GetFilename — Gets the filename component of a path.
GetFilePath — Gets path from a qualified/relative filename.
GetIDReference — Gets the ID off a URL (#name).
GetPathConnector — Returns path connector character.
GetUNC — Gets the UNC designator from a filename and path.
GetUNCShareName — Gets a network map share name.
GetURIAuthority — Gets the authority (domain name) from URI.
GetURIComponents — Cracks a URI and returns all the components.
GetURIHost — Returns only the host name (domain) from the referenced name from URI.
GetURIName — Gets the name from URI.
GetURIPath — Gets the Path and Filename from URI.
GetURIQuery — Gets the query data from URI.
GetURISchemeString — Returns the scheme as a string.
GetURISchemeType — Returns the scheme as URI_SCHEME_ code.
HasURIScheme — Checks for a scheme.
URIArrayToQuery — Implodes a series of query parameters into a URI query string.
URIQueryToArray — Explodes a URI query string into an array of query components.
Reference:
GetApplicationDataFolder — Gets the Application Data path with an optional base path flag.
GetApplicationDataCommonFolder — Gets the Application Common Data path with an optional base path flag.
GetApplicationDataLocalFolder — Gets the Application Local Data path with an optional base path flag.
GetApplicationExecuteFolder — Gets the primary module path (application path).
GetApplicationFilename — Gets the primary module file and path (application).
GetApplicationSettingsName — Gets the application settings (INI) filename and path.
GetDesktopFolder — Retrieves the Users Desktop path.
GetProgramFilesFolder — Gets the folder for program files.
GetSystemFolder — Gets Windows/OS path.
GetTempFileFolder — Gets the users temporary area or area designated for the application.
Testers:
IsFilenameValid — Tests for a valid filename by checking the characters. (Does not check for an EDGAR compliant name.)
IsInTempFolder — Tests for the filename and path in the scope of the application temp area.
IsPath — Tests for any path characters.
IsPathDrive — Tests for the path having a drive root.
IsPathQualified — Tests for the path being a root (starts with scheme, drive, UNC or /).
IsPathUNC — Tests for the path having a UNC root.
IsPathQualifiedWeb — Tests for the path having a web scheme root
IsPathQualifiedWindows — Tests for the path having a windows root.
IsPathTopLevel — Tests for the path being windows root (i.e., D:\ or \\dog\).
IsSamePath — Compares the path portion of two qualified filenames.
Table of Contents | < < Previous | Next >> |
© 2012-2024 Novaworks, LLC. All rights reserved worldwide. Unauthorized use, duplication or transmission prohibited by law. Portions of the software are protected by US Patents 10,095,672, 10,706,221 and 11,210,456. GoFiler™ and Legato™ are trademarks of Novaworks, LLC. EDGAR® is a federally registered trademark of the U.S. Securities and Exchange Commission. Novaworks is not affiliated with or approved by the U.S. Securities and Exchange Commission. All other trademarks are property of their respective owners. Use of the features specified in this language are subject to terms, conditions and limitations of the Software License Agreement.