filenames

2 views
Skip to first unread message

Ralf Hemmecke

unread,
Jul 31, 2026, 6:07:55 AM (5 days ago) Jul 31
to fricas-devel
There are certainly forbidden characters in filenames, so I would have
to escape them. Is there already some support for that in FriCAS, i,e.
a function esc: String->String so that

tf: TextFile := open(esc("si;(\_^a $b)p[")::FileName, "output")$TextFile

with actually any string inside esc create a proper file?
A lisp function would also currently satisfy my wish.

Thank you
Ralf

Waldek Hebisch

unread,
Jul 31, 2026, 8:07:46 AM (5 days ago) Jul 31
to 'Ralf Hemmecke' via FriCAS - computer algebra system
FriCAS currently passes names without any change to Lisp. I am
not sure if there are some special cases, but normal names are
passed without change to the operating system.

It is not clear what you want to do. Normal case is that we use
names choosen by the user. It is user resonsibilty to choose
legal name and ensure that OS behaviour will not cause unexpected
name clashes.

If you want to store arbitrary data in file names then reasonably
safe way is to use base 36 encoding, that is convert to integer
first and print integer in base 36. We have support for printing in
different bases, convertion to integers would be for you to provide.

--
Waldek Hebisch
Reply all
Reply to author
Forward
0 new messages