I don't understand why it doesn't work persistent

:- persistent
   app_info(key:atom, value:any).

open_db(_) :-
open_db(Dir) :-
    setting(database, Spec),
    atom_concat(Dir, Spec, PathFile),
    db_attach(PathFile, [sync(close)]), !.

I expect to see app_info.db in the directory, but I don’t find anything there.

?- db_attach('/opt/ptasker/app_info.db', []).

I try to create it manually, but I still don’t see the file

AFAIK it lazily opens (creates) the file, so you first have to assert something into this database.