|
From: Wolfgang D. <wol...@da...> - 2024-03-02 09:23:23
|
Am 01.03.24 um 18:23 schrieb El Observatorio De Matemática:
> Hi list
>
> I want to handle a folder with more than 70000 files and 50000
> directories and delete from it several files and directories using
> Maxima, if it is possible.
> There is a package in contrib named operatingsystem that potentially can
> do this task but i can not figure out how to use it.
That package was introduced by me, cause I had to use some filesystem
operations and there was no package - but I am not a lisp expert.
> (%i3) for i in "C:\Users\Usuario\Documents\Trabajos en
> wxmaxima\MiscRepo\OldSchool\OtherNibble\RosettaCodeData-main\Task\Sudoku" do
Your 'for' loop is no valid Maxima code. Exec 'describe("for");' for the
syntax. A valid example - why do you need the for loop? - may be:
(%i30) for i in ["C:\\Users\\Usario"] do display(i);
i = C:\Users\Usario
(%o30) done
Attention: A single "\" is an escape character, so you must use "\\"
instead, otherwise it would not be shown:
(%i31) for i in ["C:\Users\Usario"] do display(i);
i = C:UsersUsario
(%o31) done
Or - as you told - a "/" works instead:
(%i32) for i in ["C:/Users/Usario"] do display(i);
i = C:/Users/Usario
Best regards, Wolfgang
P.S. If you need to delete many directories, using system() with a
operating specific command - like "rm -r directories" on Linux/Unix or
"deltree directories" on Windows might be easier.
|