summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pod/perlfunc.pod3
-rwxr-xr-xt/io/fs.t10
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
diff --git a/t/io/fs.t b/t/io/fs.t
index 9f168cbc84..88d1973448 100755
--- a/t/io/fs.t
+++ b/t/io/fs.t
@@ -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;
}