Sha256: bb1244215a2f212c150fb3350a6b8986e9e290d5b80a438f276609a7b81ec46e

Contents?: true

Size: 763 Bytes

Versions: 11

Compression:

Stored size: 763 Bytes

Contents

require_relative 'command_handler'

module Ftpd

  class CmdMdtm < CommandHandler

    def cmd_mdtm(path)
      ensure_logged_in
      ensure_file_system_supports :dir
      ensure_file_system_supports :file_info
      syntax_error unless path
      path = File.expand_path(path, name_prefix)
      ensure_accessible(path)
      ensure_exists(path)
      info = file_system.file_info(path)
      mtime = info.mtime.utc
      # We would like to report fractional seconds, too.  Sadly, the
      # spec declares that we may not report more precision than is
      # actually there, and there is no spec or API to tell us how
      # many fractional digits are significant.
      mtime = mtime.strftime("%Y%m%d%H%M%S")
      reply "213 #{mtime}"
    end

  end

end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
ftpd-1.1.1 lib/ftpd/cmd_mdtm.rb
ftpd-1.1.0 lib/ftpd/cmd_mdtm.rb
investtools-ftpd-1.0.1 lib/ftpd/cmd_mdtm.rb
ftpd-1.0.1 lib/ftpd/cmd_mdtm.rb
ftpd-1.0.0 lib/ftpd/cmd_mdtm.rb
ftpd-0.17.0 lib/ftpd/cmd_mdtm.rb
ftpd-0.16.0 lib/ftpd/cmd_mdtm.rb
ftpd-0.15.0 lib/ftpd/cmd_mdtm.rb
ftpd-0.14.0 lib/ftpd/cmd_mdtm.rb
ftpd-0.13.0 lib/ftpd/cmd_mdtm.rb
ftpd-0.12.0 lib/ftpd/cmd_mdtm.rb