diff --git a/gio/GioStream.cs b/gio/GioStream.cs index 259d9d5f3..631549244 100644 --- a/gio/GioStream.cs +++ b/gio/GioStream.cs @@ -218,9 +218,16 @@ public override void SetLength (long value) { if (!CanSeek || !CanWrite) throw new NotSupportedException ("This stream doesn't support seeking"); + + var seekable = stream as Seekable; + + if (!seekable.CanTruncate ()) + throw new NotSupportedException ("This stream doesn't support truncating"); + if (is_disposed) throw new ObjectDisposedException ("The stream is closed"); - throw new NotImplementedException (); + + seekable.Truncate (value, null); } public override void Close ()