The implementation of the operations available to version 4 of the SFTP protocol.

Methods
Public Instance methods
do_name( channel, content )

Used internally to handle name packets. The on_name callback is invoked, if registered, with the driver, id, and array of items. The v4 version of this method sets the ‘longname’ member of the Name object to nil (it is not used in this version).

    # File lib/net/sftp/protocol/04/impl.rb, line 73
73:     def do_name( channel, content )
74:       return unless has_on_name?
75:       id = content.read_long
76:       items = []
77:       content.read_long.times do
78:         items.push( Name.new( content.read_string, nil,
79:           @attr_factory.from_buffer( content ) ) )
80:       end
81:       call_on_name( driver, id, items )
82:     end
fstat( id, handle, flags=nil )

In version 4, fstat accepts a flags parameter. If flags is nil, it will default to returning all attributes. Otherwise, the flags parameter should be a bitwise combination of the F_xxx constants of Net::SFTP::Protocol::V_04::Attributes.

    # File lib/net/sftp/protocol/04/impl.rb, line 45
45:     def fstat( id, handle, flags=nil )
46:       fstat_raw id, handle, convert_flags( flags )
47:     end
lstat( id, filename, flags=nil )

In version 4, lstat accepts a flags parameter. If flags is nil, it will default to returning all attributes. Otherwise, the flags parameter should be a bitwise combination of the F_xxx constants of Net::SFTP::Protocol::V_04::Attributes.

    # File lib/net/sftp/protocol/04/impl.rb, line 37
37:     def lstat( id, filename, flags=nil )
38:       lstat_raw id, filename, convert_flags( flags )
39:     end
rename( id, name, new_name, flags=0 )

In version 4, rename accepts a flags parameter. The valid flags are a combination of the following:

  • FXP_RENAME_OVERWRITE (0x01)
  • FXP_RENAME_ATOMIC (0x02)
  • FXP_RENAME_NATIVE (0x04)

Please refer to the SSH2 specification for the description of these flags.

    # File lib/net/sftp/protocol/04/impl.rb, line 57
57:     def rename( id, name, new_name, flags=0 )
58:       rename_raw id, name, new_name, flags
59:     end
stat( id, filename, flags=nil )

In version 4, stat accepts a flags parameter. If flags is nil, it will default to returning all attributes. Otherwise, the flags parameter should be a bitwise combination of the F_xxx constants of Net::SFTP::Protocol::V_04::Attributes.

    # File lib/net/sftp/protocol/04/impl.rb, line 29
29:     def stat( id, filename, flags=nil )
30:       stat_raw id, filename, convert_flags( flags )
31:     end