diff options
Diffstat (limited to 'mysql-test/include/truncate_file.inc')
-rw-r--r-- | mysql-test/include/truncate_file.inc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/include/truncate_file.inc b/mysql-test/include/truncate_file.inc new file mode 100644 index 00000000000..c82108681bd --- /dev/null +++ b/mysql-test/include/truncate_file.inc @@ -0,0 +1,16 @@ +# truncate a giving file, all contents of the file are be cleared + +if (`SELECT 'x$file' = 'x'`) +{ + --echo Please assign a file name to $file!! + exit; +} + +let TRUNCATE_FILE= $file; + +perl; +use Env; +Env::import('TRUNCATE_FILE'); +open FILE, '>', $TRUNCATE_FILE || die "Can not open file $file"; +close FILE; +EOF |