# Test for mktemp family of commands in File::Temp
# Use STANDARD safe level for these tests
use strict;
use Test;
use FileHandle;
# MKSTEMP - test
# Create file in temp directory
# Check if the file exists
# Autoflush
# Try printing something to the file
# rewind the file
# Read from the file
# compare with previous string
# Tidy up
# This test fails on Windows NT since it seems that the size returned by
# stat(filehandle) does not always equal the size of the stat(filename)
# This must be due to caching. In particular this test writes 7 bytes
# to the file which are not recognised by stat(filename)
# Simply waiting 3 seconds seems to be enough for the system to update
sleep 3;
}
} else {
}
# MKSTEMPS
# File with suffix. This is created in the current directory so
# may be problematic on NFS
# Check if the file exists
# This fails if you are running on NFS
# If this test fails simply skip it rather than doing a hard failure
} else {
}
# MKDTEMP
# Temp directory
# Need to tidy up after myself
# MKTEMP
# Just a filename, not opened
# Okay if template no longer has XXXXX in