Truncate a file: Difference between revisions
m
→{{header|Sidef}}: modified the code to work with Sidef 2.30
SqrtNegInf (talk | contribs) m (→{{header|Perl 6}}: use native type) |
m (→{{header|Sidef}}: modified the code to work with Sidef 2.30) |
||
Line 969:
=={{header|Sidef}}==
<lang ruby>func truncate(filename, len) {
var file = File
len > file.size ->
&& die "The provided length is greater than the length of the file";
file.truncate(len);
}
# truncate "file.ext" to 1234 bytes
|