Visara Master Console Center Scripting Guide Manuale Utente Pagina 149

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 262
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 148
Chapter 5 Script Commands
Scripting Guide 149
MKTEMP
Syntax:
MKTEMP($Pattern) ==> $FileName
Description:
Returns a unique file name.
Action:
Creates a file name based on the given pattern that is
guaranteed to be unique (not used) at the time of
creation. This is intended for use in situations where a
temporary file name is needed. Please note that
MKSTEMP is preferred to avoid race conditions.
MKTEMP is provided for backward compatibility.
Parameters:
$Pattern: String expression. This is a filename with
some number of 'Xs' appended to it. The 'Xs' will be
replaced with letters and numbers so that the
filename is unique.
Returns:
String value, unique file name (or am empty string on
failure)
Example:
$TempFileName := MKTEMP("/tmp/fooXXXXXX")
$Command := "ls -la > " + $TempFileName
%rc := SYSEXEC( $Command )
IF ( %rc >= 0 )
%Handle := FOPEN( $TempFileName )
IF ( %Handle != ERROR )
%rc := FREAD( %Handle, $Temp )
IF ( %rc >= 0 )
LOG( LOG_FLT, "First line is " + STR(
$Temp ), 8)
ENDIF
ENDIF
ENDIF
See Also:
MKSTEMP, SYSEXEC, FOPEN
Vedere la pagina 148
1 2 ... 144 145 146 147 148 149 150 151 152 153 154 ... 261 262

Commenti su questo manuale

Nessun commento