Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,11 @@
-module( truncate ).
-export( [file/2] ).
file( Name, Size ) ->
{file_exists, true} = {file_exists, filelib:is_file( Name )},
{ok, IO} = file:open( Name, [read, write] ),
{ok, Max} = file:position( IO, eof ),
{correct_size, true} = {correct_size, (Size < Max)},
{ok, Size} = file:position( IO, {bof, Size} ),
ok = file:truncate( IO ).