Truncate a file: Difference between revisions
Content added Content deleted
m (→{{header|R}}) |
Alextretyak (talk | contribs) (Added 11l) |
||
Line 14: | Line 14: | ||
This task permits the use of such facilities. However, such behaviour should be noted, or optionally a warning message relating to an non change or increase in file size may be implemented. |
This task permits the use of such facilities. However, such behaviour should be noted, or optionally a warning message relating to an non change or increase in file size may be implemented. |
||
<br><br> |
<br><br> |
||
=={{header|11l}}== |
|||
{{trans|Python}} |
|||
<lang 11l>F truncate_file(name, length) |
|||
I !fs:is_file(name) |
|||
R 0B |
|||
I length >= fs:file_size(name) |
|||
R 0B |
|||
fs:resize_file(name, length) |
|||
R 1B</lang> |
|||
=={{header|Ada}}== |
=={{header|Ada}}== |