beautypg.com

Mkdtemp – Visara Master Console Center Scripting Guide User Manual

Page 147

background image

Chapter 5 Script Commands

Scripting Guide

147

MKDTEMP

Syntax:

MKDTEMP($Pattern) ==> $DirectoryName

Description:

Creates a unique temporary directory for I/O access.

Action:

A directory that is guaranteed to be uniquely named and not

accessible by other users is created. As this is a temporary
directory, it and all of the contained files will be removed from the

system at the time the calling script terminates.

Parameters:

$Pattern: String expression. This is a case sensitive template to
be used by the system to create a directory name. The last six

characters of the template must be XXXXXX (all uppercase) and

these are replaced with a string that makes the directory name
unique. The directory is created with permissions insuring access

only this user.

Returns:

String value, as follows:

"" (empty string) = Error occurred while attempting to create the
directory.
Any other value = A unique directory name to be used for

subsequent access by the current script.

Example:

$tmpdir := MKDTEMP("/usr/ics/tmpXXXXXX")
IF ( $tmpdir == "" )
LOG( LOG_FLT, "Error creating temporary directory!",
6)
ELSE
LOG( LOG_FLT, "Directory is " + $tmpdir, 6)
ENDIF

See Also:

MKSTEMP, FREAD, FWRITE, FCLOSE, FILENO