IronRuby.Builtins.RubyFileOps.Truncate C# (CSharp) Method

Truncate() private method

private Truncate ( ConversionStorage toPath, RubyClass self, object path, [ size ) : int
toPath ConversionStorage
self RubyClass
path object
size [
return int
        public static int Truncate(ConversionStorage<MutableString>/*!*/ toPath, RubyClass/*!*/ self, object path, [DefaultProtocol]int size) {
            if (size < 0) {
                throw new InvalidError();
            }
            using (RubyFile f = new RubyFile(self.Context, self.Context.DecodePath(Protocols.CastToPath(toPath, path)), IOMode.ReadWrite)) {
                f.Length = size;
            }
            return 0;
        }
#endif

Same methods

RubyFileOps::Truncate ( IronRuby.Builtins.RubyFile self, [ size ) : int