testftpd 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -76,6 +76,16 @@ module TestFtpd
|
|
76
76
|
end
|
77
77
|
true
|
78
78
|
end
|
79
|
+
|
80
|
+
def self.format_list_entry(file_system_provider)
|
81
|
+
raw = (file_system_provider.directory?) ? 'd': '-'
|
82
|
+
raw += 'rw-rw-rw- 1 ftp ftp '
|
83
|
+
raw += file_system_provider.ftp_size.to_s + ' '
|
84
|
+
raw += file_system_provider.ftp_date.strftime('%b %d %H:%M') + ' '
|
85
|
+
raw += file_system_provider.ftp_name
|
86
|
+
raw += "\r\n"
|
87
|
+
raw
|
88
|
+
end
|
79
89
|
end
|
80
90
|
|
81
91
|
end
|
data/lib/testftpd/version.rb
CHANGED
@@ -262,7 +262,7 @@ class DynFTPServer
|
|
262
262
|
def cmd_list(file_spec)
|
263
263
|
data_connection do |data_socket|
|
264
264
|
list = thread[:cwd].ftp_list(file_spec)
|
265
|
-
list.each {|file| data_socket.puts(
|
265
|
+
list.each {|file| data_socket.puts(file.class.format_list_entry(file)) }
|
266
266
|
end
|
267
267
|
thread[:data_socket].close if thread[:data_socket]
|
268
268
|
thread[:data_socket] = nil
|