From 576d37510c67f9285bea5c0942272f10349aac32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Mon, 22 Nov 2010 18:22:53 +0000 Subject: [PATCH] fix ls/0. --- pl/utils.yap | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pl/utils.yap b/pl/utils.yap index eb5f705b0..bf31e3640 100644 --- a/pl/utils.yap +++ b/pl/utils.yap @@ -220,9 +220,17 @@ cd :- ls :- getcwd(X), - system:directory_files(X, L), + '$load_system_ls'(X,L), '$do_print_files'(L). +'$load_system_ls'(X,L) :- + '$undefined'(directory_files(X, L), operating_system_support), + load_files(library(system),[silent(true)]), + fail. +'$load_system_ls'(X,L) :- + operating_system_support:directory_files(X, L). + + '$do_print_files'([]) :- nl. '$do_print_files'([F| Fs]) :-