From 10aaa559a6e1596678b6d70e98cee27b9b332840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E7=82=9C?= Date: Tue, 13 Mar 2018 15:53:43 +0800 Subject: [PATCH] match in file size --- fuse_rsync.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fuse_rsync.py b/fuse_rsync.py index 1df95fe..57eba09 100644 --- a/fuse_rsync.py +++ b/fuse_rsync.py @@ -70,7 +70,7 @@ def list(self, path = '/'): in a datetime object) and *filename* (The file's name). """ # See http://stackoverflow.com/questions/10323060/printing-file-permissions-like-ls-l-using-stat2-in-c for modes - RE_LINE = re.compile("^([ldcbps-]([r-][w-][x-]){3})\s+([0-9]+)\s+([0-9]{4}/[0-9]{2}/[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}) (.*)$") + RE_LINE = re.compile("^([ldcbps-]([r-][w-][x-]){3})\s+([\d,]+)\s+([0-9]{4}/[0-9]{2}/[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}) (.*)$") remote_url = self._remote_url + path try: cmdline = ["rsync", "--list-only", remote_url] @@ -86,7 +86,7 @@ def list(self, path = '/'): listing.append({ "attrs": self._parse_attrs(match.group(1)), - "size": int(match.group(3)), + "size": int(match.group(3).replace(',','')), "timestamp": datetime.datetime.strptime(match.group(4), "%Y/%m/%d %H:%M:%S"), "filename": match.group(5) })