Skip to content

Commit bc80d32

Browse files
committed
streaming friendly method of getting filesize
1 parent c27774b commit bc80d32

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

cwltool/command_line_tool.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -693,16 +693,15 @@ def collect_output(self,
693693
if binding.get("loadContents") or compute_checksum:
694694
contents = f.read(CONTENT_LIMIT)
695695
if binding.get("loadContents"):
696-
files["contents"] = contents.decode("utf-8")
696+
files["contents"] = contents.decode("utf-8")
697697
if compute_checksum:
698698
checksum = hashlib.sha1()
699699
while contents != b"":
700700
checksum.update(contents)
701701
contents = f.read(1024 * 1024)
702702
files["checksum"] = "sha1$%s" % checksum.hexdigest()
703703
f.seek(0, 2)
704-
filesize = f.tell()
705-
files["size"] = filesize
704+
files["size"] = fs_access.size(rfile["location"])
706705

707706
optional = False
708707
single = False

0 commit comments

Comments
 (0)