fix exists/1
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2148 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
381a3401ac
commit
2fe3053c78
11
pl/boot.yap
11
pl/boot.yap
@ -1016,7 +1016,16 @@ access_file(F,Mode) :-
|
||||
'$exists'(F,Mode) :-
|
||||
get_value(fileerrors,V),
|
||||
set_value(fileerrors,0),
|
||||
( '$open'(F,Mode,S,0,1) -> '$close'(S), set_value(fileerrors,V) ; set_value(fileerrors,V), fail).
|
||||
system:true_file_name(F, F1),
|
||||
(
|
||||
'$open'(F1,Mode,S,0,1)
|
||||
->
|
||||
'$close'(S),
|
||||
set_value(fileerrors,V)
|
||||
;
|
||||
set_value(fileerrors,V),
|
||||
fail
|
||||
).
|
||||
|
||||
|
||||
% term expansion
|
||||
|
11
pl/yio.yap
11
pl/yio.yap
@ -359,7 +359,7 @@ open_pipe_streams(P1,P2) :- '$open_pipe_stream'(P1, P2).
|
||||
fileerrors :- set_value(fileerrors,1).
|
||||
nofileerrors :- set_value(fileerrors,0).
|
||||
|
||||
exists(F) :- '$exists'(F,read).
|
||||
exists(F) :- '$exists'(F,'$csult').
|
||||
|
||||
see(user) :- !, set_input(user_input).
|
||||
see(F) :- var(F), !,
|
||||
@ -989,15 +989,6 @@ at_end_of_line(S) :-
|
||||
|
||||
consult_depth(LV) :- '$show_consult_level'(LV).
|
||||
|
||||
'$exists'(F,Mode,AbsFile) :-
|
||||
get_value(fileerrors,V),
|
||||
set_value(fileerrors,0),
|
||||
( '$open'(F,Mode,S,0,0), !,
|
||||
'$file_name'(S, AbsFile),
|
||||
'$close'(S), set_value(fileerrors,V);
|
||||
set_value(fileerrors,V), fail).
|
||||
|
||||
|
||||
current_char_conversion(X,Y) :-
|
||||
var(X), !,
|
||||
'$all_char_conversions'(List),
|
||||
|
Reference in New Issue
Block a user