developed by © SANFACE Software
Version 1.2 30th September 1999
|
|
Every PERL tool use temporary files.
If you want your code can be simply portable on different OS, you need to select
the correct temporary directory.
The purpose of this module is to check the correct temporary directory in every
OS supported by PERL to use it.
We need your help.
We ask you to send us the correct tempory directory for every OS supported by
PERL and to suggest us good modifies (sanface@sanface.com).
At the moment this is the list of OS supported and the list of variables and
directories the module check to find the correct to use:
Windows 32 bit ('95, '98, NT) | $ENV{TEMP}, $ENV{TMP}, $ENV{windir} . '\\temp', 'c:\\temp', '.' |
Unix
[aix bsd386 dec_osf dgux freebsd hp_osf1 hpux
irix linux mips_osf1 netbsd next sco sco_xenix
solaris sunos svr4 sysv ultrix uts] | $ENV{TMPDIR}, '/var/tmp', '/usr/tmp', '/tmp', '.' |
Mac | $ENV{TMPDIR} |
OpenVMS | /sys\$scratch/ (or SYS\$SCRATCH) |
BeOS | /tmp |
If the module can't recognize your OS the temporary directory is set to .
Use testtmpdir.pl to test the module on your OS and testOS.pl to know the value
of $^O PERL variable on your OS.
use tmpdir;
$dir=tmpdir->new ;
print "Correct temporary directory in the $^O OS is $dir\n";
The constructor new is the only method of this library. It returns the
correct temporary directory if it checks correctly the OS, otherwise it returns
the default directory ./
The latest version of this library is likely to be available from:
Copyright 1999, SANFACE Software
This module is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
09/30/1999 version 1.2
- The default Mac OS directory can be found with the FindFolder toolbox
function
use Mac::Files;
$tmp = FindFolder(kOnSystemDisk,kTemporaryFolderType);
However, MacPerl automatically assigns this directory to $ENV{TMPDIR}.
[by Chris Nandor]
09/15/1999 version 1.1
- The name of the module is changed: TempDir
- Added a new tempdir check method for Windows 32 OS [by Markus Laker]
- Added a new similar tempdir check method for Unix
- Added BeOS support [by David Cantrell]
- The new list of Unix OS:
aix bsd386 dec_osf dgux freebsd hp_osf1 hpux irix linux mips_osf1
netbsd next sco sco_xenix solaris sunos svr4 sysv ultrix uts
09/01/1999 version 1.0
First public release