diff --git a/packages/vfs/VFS.st b/packages/vfs/VFS.st index cf02bd2..e926ea8 100644 --- a/packages/vfs/VFS.st +++ b/packages/vfs/VFS.st @@ -183,9 +183,17 @@ Commander and with GNOME VFS.'> ^Generator on: [:gen | - | pipe | + | pipe temp | pipe := FileStream popen: command , ' list ' , self file name dir: FileStream read. + + "pipe linesDo failed because FileStream popen.... seemed to be still processing stuff + while pipe Linesdo: was already executed. Now first read the entire contents of pipe to temp and + then process temp" + + temp := pipe contents. + pipe := ReadWriteStream on: temp. + pipe linesDo: [:l | | line mode size path date | @@ -200,14 +208,22 @@ Commander and with GNOME VFS.'> line skipSeparators]. size := Number readFrom: line. "File size" line skipSeparators. - date := DateTime readFrom: line. "Date" - line skipSeparators. - path := line upToAll: ' -> '. "Path" - gen yield: - {path. - size. - date. - mode}]. + date := ''. + path := ''. + [line atEnd] whileFalse: [ + path := path, (line peek) asString. + (line peek = Character space) ifTrue: [path := '']. + date := date, line next asString. + ]. + + date := ReadStream on: date. + date := DateTime readFrom: date. + + gen yield: + {path. + size. + date. + mode}]. pipe close] ] ]