diff --git a/libraries/lsp_server_metta/prolog/lsp_metta_workspace.pl b/libraries/lsp_server_metta/prolog/lsp_metta_workspace.pl index 5fa186dda6..7e96a93464 100644 --- a/libraries/lsp_server_metta/prolog/lsp_metta_workspace.pl +++ b/libraries/lsp_server_metta/prolog/lsp_metta_workspace.pl @@ -423,7 +423,7 @@ retractall(lsp_state:made_metta_file_buffer(Path)), retractall(lsp_cache:gave_document_symbols(Path,_)), %metta_file_buffer(0,_Ord,_Kind, _Term, _NamedVarsList, Path, _Pos) - symbol_concat(Path, '.buffer~', BufferFile), + cache_file(Path, '.buffer~', BufferFile), if_t(exists_file(BufferFile),delete_file(BufferFile)), retractall(user:metta_file_buffer(_Lvl,_Ord,_Kind, _Term, _NamedVarsList, Path, _Pos)))),!. diff --git a/prolog/metta_lang/metta_loader.pl b/prolog/metta_lang/metta_loader.pl index c50bbcb293..d9f1323976 100755 --- a/prolog/metta_lang/metta_loader.pl +++ b/prolog/metta_lang/metta_loader.pl @@ -1877,13 +1877,13 @@ ( exists_directory(Dir) -> directory_files(Dir, Items), forall(member(Item, Items), - ( Item \= '.', Item \= '..', + ignore(( Item \= '.', Item \= '..', directory_file_path(Dir, Item, FilePath), ( (exists_file(FilePath), atom_concat(_,Ending, FilePath)) -> delete_file(FilePath) ; true ) - )) + ))) ; true ). @@ -1906,7 +1906,8 @@ -> TempDir = 'C:/Windows/Temp' ; TempDir = '/tmp' )), - atomic_list_concat([TempDir, '/metta_cache/'], Dir). + absolute_file_name(TempDir,TDir,[access(write),file_type(directory)]),!, + directory_file_path(TDir,'metta_cache',Dir). %! fr_slashes(+Pairs, +In, -Out) is det. % diff --git a/prolog/metta_lang/metta_parser.pl b/prolog/metta_lang/metta_parser.pl index 34ce46fcea..91d1dc8740 100644 --- a/prolog/metta_lang/metta_parser.pl +++ b/prolog/metta_lang/metta_parser.pl @@ -862,7 +862,7 @@ :- dynamic ok_to_stop/1. process_expressions(FileName,_InStream, _OutStream) :- atomic(FileName), fail, - symbol_concat(FileName, '.buffer~', BufferFile), + cache_file(FileName, BufferFile), exists_file(BufferFile), use_cache_file(FileName, BufferFile), ensure_loaded(BufferFile), !. @@ -877,8 +877,8 @@ assertz(ok_to_stop(FileName, false)), % Start a thread to report progress every 30 seconds - get_time(StartTime), % Record the start time - thread_create(report_file_progress(FileName, InStream, TotalLines, StartTime), _, [detached(true)]), + % get_time(StartTime), % Record the start time + % thread_create(report_file_progress(FileName, InStream, TotalLines, StartTime), _, [detached(true)]), ignore(stream_property(InStream, file_name(Stem))), % Get the file name of the stream. ignore(Stem = FileName), % Assign the input file name if no stream file name.