user:prolog_file_type/2.

avoid using old OS stuff, if we have it in.
This commit is contained in:
Vitor Santos Costa 2011-06-13 01:43:40 +01:00
parent 2aa76a546c
commit d6e87420e3
2 changed files with 9 additions and 2 deletions

View File

@ -834,8 +834,8 @@ absolute_file_name(File,Opts,TrueFileName) :-
'$to_list_of_atoms'(As, L1, [A|L2]),
'$to_list_of_atoms'(Bs, L2, LF).
'$get_abs_file'(File,opts(_,D0,_,_,_,_,_),AbsFile) :-
operating_system_support:true_file_name(File,D0,AbsFile).
'$get_abs_file'(File,opts(_,_D0,_,_,_,_,_),AbsFile) :-
'$absolute_file_name'(File,AbsFile).
'$search_in_path'(File,opts(Extensions,_,Type,Access,_,_,_),F) :-
'$add_extensions'(Extensions, File, F0),
@ -870,6 +870,9 @@ absolute_file_name(File,Opts,TrueFileName) :-
'$add_type_extensions'(Type,File,F) :-
'$type_extension'(Type,Ext),
atom_concat([File,Ext],F).
'$add_type_extensions'(Type,File,F) :-
user:prolog_file_type(Type, File),
atom_concat([File,Ext],F).
'$type_extension'(txt,'').
'$type_extension'(prolog,'.yap').

View File

@ -168,6 +168,10 @@ yap_hacks:cut_by(CP) :- '$$cut_by'(CP).
:- dynamic goal_expansion/3.
:- multifile prolog_file_type/2.
:- dynamic prolog_file_type/2.
:- multifile goal_expansion/2.
:- dynamic goal_expansion/2.