1# See the file LICENSE for redistribution information. 2# 3# Copyright (c) 2001,2008 Oracle. All rights reserved. 4# 5# $Id: bigfile002.tcl,v 12.9 2008/04/22 09:39:29 winter Exp $ 6# 7# TEST bigfile002 8# TEST This one should be faster and not require so much disk space, 9# TEST although it doesn't test as extensively. Create an mpool file 10# TEST with 1K pages. Dirty page 6000000. Sync. 11proc bigfile002 { args } { 12 source ./include.tcl 13 global is_fat32 14 if { $is_fat32 } { 15 puts "Skipping bigfile002 for FAT32 file system." 16 return 17 } 18 puts "Bigfile002: Creating large, sparse file through mpool..." 19 flush stdout 20 21 env_cleanup $testdir 22 23 # Create env. 24 set env [berkdb_env -create -home $testdir] 25 error_check_good valid_env [is_valid_env $env] TRUE 26 27 # Create the file. 28 set name big002.file 29 set file [$env mpool -create -pagesize 1024 $name] 30 31 # Dirty page 6000000 32 set pg [$file get -create 6000000] 33 error_check_good pg_init [$pg init A] 0 34 error_check_good pg_set [$pg is_setto A] 1 35 36 # Put page back. 37 error_check_good pg_put [$pg put] 0 38 39 # Fsync. 40 error_check_good fsync [$file fsync] 0 41 42 # Close. 43 error_check_good fclose [$file close] 0 44 error_check_good env_close [$env close] 0 45} 46