Don't get lost: IMan Guides » IMan User Guide » References » VBScript Functions » File Functions

File Functions

BuildPath

Description

Append a name onto an existing path. The format of the new path is ‘path\name'.

Syntax

  • BuildPath( path, name)

Arguments

  • path
    • A string representing a file path.
  • name
    • A string of either a subpath or file name.

FileExists

Description

Returns whether the file specified by the File argument exists.

Syntax

  • FileExists( file )

Arguments

  • file
    • The full path of the file.

FileName

Description

Returns the file name from a path.

Syntax

  • FileName( filepath )

Arguments

  • filepath
    • The full path of the file.

FilePath

Description

Returns the path from a file path.

Syntax

  • FilePath( filepath)

Arguments

  • filepath
    • The full path of the file.

ReadTextFile

Description

Reads the contents of a text file.

Syntax

  • ReadTextFile( filepath , throwonerror )

Arguments

  • filepath
    • The full path of the file.
  • throwonerror
    • When set to False the function will return an empty string instead of raising an error when an error occurs either opening or reading the file.

WriteTextFile

Description

Writes to a text file. If the file exists it will be overwritten.

Syntax

  • WriteTextFile( filepath , data )

Arguments

  • filepath
    • The full path of the file.
  • data
    • The data to write to the file.