Truncate a file F at the given file position.
import 'dart:io';
File(F).openSync(mode: FileMode.write).truncateSync(position);
using System.IO;
var F = new FileStream("F", FileMode.Open) // advance into F here F.SetLength(F.Position);
import "os"
err := os.Truncate(F, position)
Truncate(F);
use Path::Tiny qw(path);
my $F = path('F')->openrw; # ... read some from $F to advance # position of file handle (not shown) ... truncate $F, tell $F;
F.truncate(F.tell())
F.truncate(F.pos)
use std::io::Seek;
let pos = f.stream_position()?; f.set_len(pos)?;
No security, no password. Other people might choose the same nickname.