Filenames

<< Click to Display Table of Contents >>

Navigation:  FindOnClick > FindOnClick For Advanced Users > Scripting > Functions >

Filenames

 

function ExtractFileName(Filename);

 

Filename: The full path to extract the filename from.

 

Return value: The filename, including extension. For example: ExtractFilename('C:\path\filename.txt') would return 'filename.txt'

 

 

function ExtractFileExt(Filename);

 

Filename: The filename to extract the file extension from.

 

Return value: The extension, including the period (.). For example: ExtractFileExt('C:\path\filename.txt') would return '.txt'

 

 

function ExtractFileDrive(Filename);

 

Filename: The full path to extract the drive from.

 

Return value: The drive or UNC path. For example: ExtractFileDrive('C:\path\filename.txt') would return 'C:'

 

 

function ExtractFileDir(Filename);

 

Filename: The full path to extract the drive and directory from.

 

Return value: The drive (or UNC path) and directory. For example: ExtractFileDir('C:\path\filename.txt') would return 'C:\path'

 

 

function ExtractFilePath(Filename);

 

Filename: The full path to extract the drive and directory from.

 

Return value: The drive (or UNC path) and directory. For example: ExtractFilePath('C:\path\filename.txt') would return 'C:\path\'

 

 

function ExtractParentDirectory(Filename);

 

Filename: The full path to extract the drive and parent directory from.

 

Return value: The drive (or UNC path) and directory. For example: ExtractParentDirectory('C:\path1\path2\') would return 'C:\path1\'

 

 

function ExcludeTrailingBackslash(Filename);

 

Filename: The filename to remove the trailing backslash from.

 

Return value: The filename with the trailing backslash, if any, removed. For example: ExtractTrailingBackslash('C:\path1\path2\') would return 'C:\path1\path2'

 

 

function IncludeTrailingBackslash(Filename);

 

Filename: The filename to add a trailing backslash to.

 

Return value: For example: IncludeTrailingBackslash('C:\path1\path2') would return 'C:\path1\path2\

 

 

function GetTempFileName;

 

Return value: Generates a unique temporary file. Call GetTempFileName to generate a new uniquely-named temporary file. GetTempFileName actually creates a zero-sized file in a temporary location and returns its name. The caller must delete the file (using DeleteFile) after it is not used anymore.

 

 

function GetGUIDFileName;

 

Return value: Generates a new GUID that can be used as a unique file name. Call GetGUIDFileName to generate a new GUID suitable as a unique name for a file or directory. GetGUIDFileName only generates a file name and does not create a real file.

 

 

function GetRandomFileName;

 

Return value: Generates a new random file name. Call GetRandomFileName to generate a new random file name. GetRandomFileName does not guarantee a unique file name. If a unique file name is desired, use GetGUIDFileName method instead. To generate a real uniquely-named temporary file, use the GetTempFileName method.

 

 

function GetTempPath;

 

Return value: Returns the path to a directory to store temporary files. This directory is a system-managed location; files saved here may be deleted between application sessions or system restarts.

 

 

function GetHomePath;

 

Return value: Returns either the home path of the user or the application's writable scratch directory or storage, e.g. C:\Users\[username]\AppData\Roaming

 

 

function GetDocumentsPath;

 

Return value: Returns the path to the directory where user documents are stored, e.g. C:\Users\[username]\Documents

 

 

function GetSharedDocumentsPath;

 

Return value: Returns the path to the directory where documents shared between users are stored, e.g. C:\Users\Public\Documents

 

 

function GetCachePath;

 

Return value: Returns the path to the directory where your application can store cache files, e.g. C:\Users\[username]\AppData\Local

 

 

function GetPicturesPath;

 

Return value: Returns the path to the directory where user pictures are stored, e.g. C:\Users\[username]\Pictures

 

 

function GetSharedPicturesPath;

 

Return value: Returns the path to the directory where user shared pictures are stored, e.g. C:\Users\Public\Pictures

 

 

function GetPublicPath;

 

Return value: Returns the path to the directory where you can store application data that can be shared with other applications, e.g. C:\ProgramData

 

 

function GetCameraPath;

 

Return value: Returns the path to the directory where user pictures taken with a camera are stored, e.g. C:\Users\[username]\Pictures

 

 

function GetSharedCameraPath;

 

Return value: Returns the path to the directory where user shared pictures taken with a camera are stored, e.g. C:\Users\Public\Pictures

 

 

function GetMusicPath;

 

Return value: Returns the path to the directory where user music is stored, e.g. C:\Users\[username]\Music

 

 

function GetSharedMusicPath;

 

Return value: Returns the path to the directory where user shared music is stored, e.g. C:\Users\Public\Music

 

 

function GetMoviesPath;

 

Return value: Returns the path to the directory where user movies are stored, e.g. C:\Users\[username]\Videos

 

 

function GetSharedMoviesPath;

 

Return value: Returns the path to the directory where user shared movies are stored, e.g. C:\Users\Public\Videos

 

 

 

 

<%SBCOPYRIGHT%>