Sha256: 555ea13ea5d96b89a2e380f2132a61b6a664adfbef5b51ba19d799b07617938b

Contents?: true

Size: 565 Bytes

Versions: 5

Compression:

Stored size: 565 Bytes

Contents

require_relative 'command_handler'

module Ftpd

  class CmdStru < CommandHandler

    def cmd_stru(argument)
      syntax_error unless argument
      ensure_logged_in
      name, implemented = FILE_STRUCTURES[argument]
      error "504 Invalid structure code" unless name
      error "504 Structure not implemented" unless implemented
      self.structure = argument
      reply "200 File structure set to #{name}"
    end

    private

    FILE_STRUCTURES = {
      'R'=>['Record', false],
      'F'=>['File', true],
      'P'=>['Page', false],
    }

  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ftpd-0.16.0 lib/ftpd/cmd_stru.rb
ftpd-0.15.0 lib/ftpd/cmd_stru.rb
ftpd-0.14.0 lib/ftpd/cmd_stru.rb
ftpd-0.13.0 lib/ftpd/cmd_stru.rb
ftpd-0.12.0 lib/ftpd/cmd_stru.rb