Skip to content

Commit 5413ff1

Browse files
committed
FIX: list-dir stopping its output on symbolic link to not existing file
resolves: Oldes/Rebol-issues#2566
1 parent ea51540 commit 5413ff1

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/mezz/mezz-files.reb

+9-6
Original file line numberDiff line numberDiff line change
@@ -274,17 +274,20 @@ list-dir: closure/with [
274274
/local info date time size
275275
][
276276
info: query/mode value [name size date]
277+
unless info [
278+
return ajoin [
279+
"^[[1;35m *** Invalid symbolic link: ^[[0;35m"
280+
second split-path value
281+
"^[[m"
282+
]
283+
]
277284
if depth = 0 [
278285
return ajoin ["^[[33;1mDIR: ^[[32;1m" to-local-file info/1 "^[[m"]
279286
]
280-
;@@ TODO: rewrite this date/time formating once it will be possible
281-
;@@ with some better method!
287+
282288
date: info/3
283289
date/zone: 0
284-
time: date/time
285-
time: format/pad [2 #":" 2 ] reduce [time/hour time/minute] #"0"
286-
date: format/pad [-11] date/date #"0"
287-
date: ajoin [" ^[[32m" date " " time "^[[m "]
290+
date: ajoin [" ^[[32m" format-date-time date "dd-mmm-yyyy hh:mm" "^[[m "]
288291

289292
size: any [info/2 0]
290293
if size >= 100'000'000 [size: join to integer! round (size / 1'000'000) "M"]

0 commit comments

Comments
 (0)