diff options
author | Michael G. Schwern <schwern@pobox.com> | 2002-04-27 19:20:19 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-04-28 02:19:45 +0000 |
commit | 90ddc76f9d83e9e7fbcf3b00abfef011f142b34e (patch) | |
tree | 554a2eb4d414ebfb4a7d28554f132d6bc9f3dfc1 | |
parent | c193270f154d69780abbcc5b212fb29de0665792 (diff) | |
download | perl-90ddc76f9d83e9e7fbcf3b00abfef011f142b34e.tar.gz |
Truncate the truncate tests (was Re: truncate to grow file)
Message-ID: <20020428032019.GF1821@blackrider>
p4raw-id: //depot/perl@16239
-rw-r--r-- | pod/perlfunc.pod | 3 | ||||
-rwxr-xr-x | t/io/fs.t | 10 |
2 files changed, 5 insertions, 8 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 850c88703c..131d4777eb 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -5644,6 +5644,9 @@ specified length. Produces a fatal error if truncate isn't implemented on your system. Returns true if successful, the undefined value otherwise. +The behavior is undefined if LENGTH is greater than the length of the +file. + =item uc EXPR =item uc @@ -263,7 +263,7 @@ close(IOFSCOM); SKIP: { # Check truncating a closed file. eval { truncate "Iofs.tmp", 5; }; - + skip("no truncate - $@", 10) if $@; is(-s "Iofs.tmp", 5, "truncation to five bytes"); @@ -295,7 +295,7 @@ SKIP: { if ($needs_fh_reopen) { close (FH); open (FH, ">>Iofs.tmp") or die "Can't reopen Iofs.tmp"; } - + if ($^O eq 'vos') { skip ("# TODO - hit VOS bug posix-973 - cannot resize an open file below the current file pos.", 7); } @@ -310,12 +310,6 @@ SKIP: { ok(-z "Iofs.tmp", "fh resize to zero working (filename check)"); - ok(truncate(FH, 200), "fh resize to 200"); - is(-s FH, 200, "fh resize to 200 working (FH check)"); - - ok(truncate(FH, 0), "fh resize to 0"); - ok(-z FH, "fh resize to 0 working (FH check)"); - close FH; } |