file.save works with full pathname + filename only

Here we can discuss about the problem found
Post Reply
User avatar
PeterN
Posts: 789
Joined: Mon Feb 08, 2021 7:56 pm
Location: Krefeld, Germany
Has thanked: 368 times
Been thanked: 442 times
Contact:

file.save works with full pathname + filename only

Post by PeterN »

I use 1.70.5 LFS at a ATOM Matrix and an ESP32-C3.
FILE.save or file.write do work with full pathnames but seem to do nothing, if the filename is a relative one without a directory name.

Code: [Local Link Removed for Guests]

file.save "/test_abs.txt",time$   'OK
file.save "test_rel.txt",time$    'not OK
wlog time$
Have I left something out?
User avatar
cicciocb
Site Admin
Posts: 3135
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 635 times
Been thanked: 2234 times
Contact:

Re: file.save works with full pathname + filename only

Post by cicciocb »

It is not really a bug, the path must always be "full".
This is applicable to all the file commands.

The "relative" cannot work as there is no "notion" of current path.

This Is something that I could implement in the future (something like curpat$)
User avatar
PeterN
Posts: 789
Joined: Mon Feb 08, 2021 7:56 pm
Location: Krefeld, Germany
Has thanked: 368 times
Been thanked: 442 times
Contact:

Re: file.save works with full pathname + filename only

Post by PeterN »

Thanks, Francesco.
It isn’t a challenge to use full path filenames now, but since there was
- neither an error message
- nor a hint in the online help,
it took some time to find out why my new setup values were not being stored.
Post Reply