Sha256: 93dca7b88df55b3f8de9fcbab0e0017c4853b2a031c9184530b2ed629a949967

Contents?: true

Size: 597 Bytes

Versions: 6

Compression:

Stored size: 597 Bytes

Contents

require_relative 'command_handler'

module Ftpd

  class CmdStou < CommandHandler

    def cmd_stou(argument)
      close_data_server_socket_when_done do
        ensure_logged_in
        ensure_file_system_supports :write
        path = argument || 'ftpd'
        path = File.expand_path(path, name_prefix)
        path = unique_path(path)
        ensure_accessible path
        ensure_exists File.dirname(path)
        receive_file(File.basename(path)) do |data_socket|
          file_system.write path, data_socket
        end
        reply "226 Transfer complete"
      end
    end

  end

end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
ftpd-1.1.1 lib/ftpd/cmd_stou.rb
ftpd-1.1.0 lib/ftpd/cmd_stou.rb
investtools-ftpd-1.0.1 lib/ftpd/cmd_stou.rb
ftpd-1.0.1 lib/ftpd/cmd_stou.rb
ftpd-1.0.0 lib/ftpd/cmd_stou.rb
ftpd-0.17.0 lib/ftpd/cmd_stou.rb