From 6fc97b5109ea1a7db7a1ff5ed549689244a35c03 Mon Sep 17 00:00:00 2001 From: Jessica Luke Date: Mon, 18 Apr 2016 16:09:19 -0400 Subject: [PATCH] Add some basic information instead of returning blank info for the root --- fs/ftpfs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/ftpfs.py b/fs/ftpfs.py index 4a43328..cf67cad 100644 --- a/fs/ftpfs.py +++ b/fs/ftpfs.py @@ -865,6 +865,7 @@ class FTPFS(FS): 'atomic.rename' : True, 'atomic.setcontents' : False, 'file.read_and_write' : False, + 'mime_type': 'virtual/ftp', } def __init__(self, host='', user='', passwd='', acct='', timeout=_GLOBAL_DEFAULT_TIMEOUT, port=21, dircache=True, follow_symlinks=False): @@ -1350,7 +1351,7 @@ def rename(self, src, dst): def getinfo(self, path): dirlist, fname = self._check_path(path) if not fname: - return {} + return { 'size': 0, 'isdir': True, 'isfile': False } info = dirlist[fname].copy() info['modified_time'] = datetime.datetime.fromtimestamp(info['mtime']) info['created_time'] = info['modified_time']