public void ftruncate(long newLength) throws IOException, PipeException, InvalidValueException, BadDescriptorException { stream.ftruncate(newLength); }
public void ftruncate(long newLength) throws IOException, PipeException, InvalidValueException, BadDescriptorException { stream.ftruncate(newLength); }
public void ftruncate(long newLength) throws IOException, PipeException, InvalidValueException, BadDescriptorException { stream.ftruncate(newLength); }
public void ftruncate(long newLength) throws IOException, PipeException, InvalidValueException, BadDescriptorException { stream.ftruncate(newLength); }
@JRubyMethod(required = 1) public IRubyObject truncate(ThreadContext context, IRubyObject arg) { RubyInteger newLength = arg.convertToInteger(); if (newLength.getLongValue() < 0) { throw context.runtime.newErrnoEINVALError(path); } try { openFile.checkWritable(context.runtime); openFile.getMainStreamSafe().ftruncate(newLength.getLongValue()); } catch (BadDescriptorException e) { throw context.runtime.newErrnoEBADFError(); } catch (PipeException e) { throw context.runtime.newErrnoESPIPEError(); } catch (InvalidValueException ex) { throw context.runtime.newErrnoEINVALError(); } catch (IOException e) { // Should we do anything? } return RubyFixnum.zero(context.runtime); }
@JRubyMethod(required = 1) public IRubyObject truncate(ThreadContext context, IRubyObject arg) { RubyInteger newLength = arg.convertToInteger(); if (newLength.getLongValue() < 0) { throw context.runtime.newErrnoEINVALError(path); } try { openFile.checkWritable(context.runtime); openFile.getMainStreamSafe().ftruncate(newLength.getLongValue()); } catch (BadDescriptorException e) { throw context.runtime.newErrnoEBADFError(); } catch (PipeException e) { throw context.runtime.newErrnoESPIPEError(); } catch (InvalidValueException ex) { throw context.runtime.newErrnoEINVALError(); } catch (IOException e) { // Should we do anything? } return RubyFixnum.zero(context.runtime); }