Sha256: 7eafc4adf2728653972ed32e9f8955fd2acd9d7b7aa09e029d6bb4044d310e25

Contents?: true

Size: 628 Bytes

Versions: 7

Compression:

Stored size: 628 Bytes

Contents

# frozen_string_literal: true

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

7 entries across 7 versions & 1 rubygems

Version Path
ftpd-2.1.0 lib/ftpd/cmd_stou.rb
ftpd-2.0.5 lib/ftpd/cmd_stou.rb
ftpd-2.0.4 lib/ftpd/cmd_stou.rb
ftpd-2.0.3 lib/ftpd/cmd_stou.rb
ftpd-2.0.2 lib/ftpd/cmd_stou.rb
ftpd-2.0.1 lib/ftpd/cmd_stou.rb
ftpd-2.0.0 lib/ftpd/cmd_stou.rb