Difference between revisions of "ObjectType:filepath"
Jump to navigation
Jump to search
(5 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
== Description == | == Description == | ||
+ | {{ObjectType-Vitals|filepath|[[LavishScript]]|[[ObjectType:unistring|unistring]]|Same as '''Path'''|[[ObjectType:mutablefilepath|mutablefilepath]]|no|const wchar_t *}} | ||
== Members == | == Members == | ||
− | *[[ | + | *[[ObjectType:bool|bool]] '''PathExists''': TRUE if the given path exists |
− | *[[ | + | *[[ObjectType:bool|bool]] '''FileExists['''additional path''']: TRUE if the given additional path exists. This can be a directory OR file, and can be an absolute path or a path relative to this filepath |
− | *[[ | + | *[[ObjectType:string|string]] '''Path''': The string representation of this path |
− | *[[ | + | *[[ObjectType:string|string]] '''AbsolutePath''': The string representation of this path converted to an absolute path |
== Methods == | == Methods == | ||
− | '' | + | *'''MakeSubdirectory['''subdir''']''': Creates a directory with name <subdir> off of this path. |
− | |||
− | |||
− | |||
== Examples == | == Examples == | ||
+ | ;Example code | ||
+ | function main() | ||
+ | { | ||
+ | declare FP filepath "c:/program files/innerspace/scripts" | ||
+ | echo FileExists[test.iss] = ${FP.FileExists[test.iss]} | ||
+ | echo Path = ${FP.Path} | ||
+ | echo PathExists = ${FP.PathExists} | ||
+ | echo AbsolutePath = ${FP.AbsolutePath} | ||
+ | } | ||
+ | ;Output | ||
+ | FileExists[test.iss] = TRUE | ||
+ | Path = c:/program files/innerspace/scripts | ||
+ | PathExists = TRUE | ||
+ | AbsolutePath = c:/program files/innerspace/scripts | ||
+ | ; Creating directories | ||
+ | declare FP filepath "${Script.CurrentDirectory}" | ||
+ | if !${FP.FileExists["Config"]} | ||
+ | { | ||
+ | FP:MakeSubdirectory["Config"] | ||
+ | } | ||
+ | FP:Set["${Script.CurrentDirectory}/Config"] | ||
+ | if !${FP.FileExists["Logs"]} | ||
+ | { | ||
+ | FP:MakeSubdirectory["Logs"] | ||
+ | } | ||
== See Also == | == See Also == | ||
− | + | {{LavishScript:ObjectType}} | |
− | |||
− | |||
− |
Latest revision as of 16:34, 8 July 2018
Contents
Description
filepath | |
Defined By | LavishScript |
Inherits | unistring |
Reduces To | Same as Path |
Variable Object Type | mutablefilepath |
Uses Sub-Types | no |
C/C++ Type | const wchar_t * |
Members
- bool PathExists: TRUE if the given path exists
- bool FileExists[additional path]: TRUE if the given additional path exists. This can be a directory OR file, and can be an absolute path or a path relative to this filepath
- string Path: The string representation of this path
- string AbsolutePath: The string representation of this path converted to an absolute path
Methods
- MakeSubdirectory[subdir]: Creates a directory with name <subdir> off of this path.
Examples
- Example code
function main() { declare FP filepath "c:/program files/innerspace/scripts" echo FileExists[test.iss] = ${FP.FileExists[test.iss]} echo Path = ${FP.Path} echo PathExists = ${FP.PathExists} echo AbsolutePath = ${FP.AbsolutePath} }
- Output
FileExists[test.iss] = TRUE Path = c:/program files/innerspace/scripts PathExists = TRUE AbsolutePath = c:/program files/innerspace/scripts
- Creating directories
declare FP filepath "${Script.CurrentDirectory}" if !${FP.FileExists["Config"]} { FP:MakeSubdirectory["Config"] } FP:Set["${Script.CurrentDirectory}/Config"] if !${FP.FileExists["Logs"]} { FP:MakeSubdirectory["Logs"] }
See Also
LavishScript Object Types
- Text
- string - mutablestring - unistring
- Numbers
- byte - float - float64 - int - uint - int64
- Boolean (TRUE/FALSE)
- bool
- Pointers
- boolptr - byteptr - floatptr - float64ptr - intptr - uintptr - int64ptr - rgbptr - stringptr
- Containers
- objectcontainer - array - index - collection - queue - stack - set - variablescope
- JSON
- jsonobject - jsonarray - jsonvaluecontainer - jsonvalue
- Iteration
- iterator - jsoniterator
- Date/Time
- time
- File Handling
- filepath - file - filelist - filelistentry
- Tasks
- lavishmachine - Accessed via the Top-Level Object LMAC
- task - tasklibrary - taskmanager - tasktype - taskpulseargs - elmactaskstate