Skip to content

Commit

Permalink
gio: Implement GioStream.SetLength
Browse files Browse the repository at this point in the history
  • Loading branch information
gburt authored and bl8 committed Jul 17, 2011
1 parent 5290f4c commit f6009bb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion gio/GioStream.cs
Expand Up @@ -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 ()
Expand Down

0 comments on commit f6009bb

Please sign in to comment.