----^--->
/\

//\\
//The\
/Sy
stem\
////
Guard
\

In the mount of the LORD it shall be seen. Genesis 22:14

TempFile

Booming Or Fuming? | MasterCatalog | ntlib (FREE) | NTCmdLib | MtCmds | Scripts | Almost Free | TheGuardBook | Help

 

Library
Resources

Constants | Functions | GlobalSwitches | GuardNotes | Command Shorthand | MountCommands | Procedures
#Constants   GLOBAL | Environment-Specific

#TempFile

Description

The complete file specification (Drive:\Path\FileName.Ext) of a session-specific, non-overlapping temporary file.

Examples, Notes and Instructions

  • #TempFile uses the equivalent "short names" for the file and path whenever possible.
  • The temporary file name is constructed in five parts:
     
    ~~   literal prefix, always two "~" characters
    %~sn0   Expands to the short file name of the script that is running when .GetTempFile is executed.  If this value is unavailable, the literal characters "%~sn0" will be part of the temporary file name.  This usually occurs because .GetTempFile has been run from a  command prompt.  The file name is still valid with the "%~sn0"  characters in it and can be used normally.
    -   literal "-" character, separates the short filename from the "random" number
    nnnnnnnn   The "random" part of the file name, loosely based on the current Precise Log Time (see #LogTimeP).  While this is not a truly "random" number, it is random enough to allow multiple simultaneous runs of the same script, on the same machine, using the same temp folder, with an extremely low chance of conflicts.
    .txt   the literal ".txt" extension allows easy viewing and editing of the file with a double-click (as opposed to ".tmp")

 

  • All of the Mount/\Commands for manipulating temporary files will use the current value of #TempFile  as their target. These commands are:

    ReadTempFile   WriteTempFile   AppendTempFile   CheckTempFile
    MarkTempFile   TouchTempFile   ShowTempFile     HideTempFile
    SortTempFile   ClearTempFile   DeleteTempFile
     
  • Constants with names in Mixed Case contain commonly needed data whose exact value(s) vary based on conditions at the time of update.

Example 1 - Full Display

ECHO:%#TempFile%
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\~~NTCmdLib-55351101.txt


Related .Mount/\Commands, #Constants, $Functions, :Procedures

Resource

  Short Description
.GetTempFile    

 

K

E

Y

Common Commands INTERNAL External /SWITCH Parameter Help text AddonTool
Mounted Commands .Mount/\Command CmdShorthand #Constant $FUNCTION :Procedure !GuardNote
Operating Systems NT/2K/XP/K3 NT Only NT/2K 2K Only 2K/XP XP Only XP/K3 K3 Only 2K/XP/K3

#Constants   GLOBAL | Environment-Specific

/\
//\\
//
The\
/Sy
stem\
////
Guard
\
COME ON UP WITH US!
and
Congratulations On Your Decision
to
RISE ABOVE
THE REST!

^
/
!\
/LIB\

TheSystemGuard.com [Revised: 2007-03-29]
Copyright © 1995-2007, JWC
Computer Communications,
All Rights Reserved, Worldwide.
 Disclaimer       Privacy       About Us       More


Communication Is Business!

We Master It With Knowledge!

^
/
.\
/M^C\