Page 1 of 1
Path to the temporary PB folder
Posted: Tue Dec 14, 2021 10:08 am
by User_Russian
When compiling, PB unpacks the libraries and creates objects files in the temporary folder. It would be nice if could specify the path in this folder. What is it for? For example, the Raspberry Pi temporary folder on microSD and the recording on it is slow. I want to create a RAM disk and arrange the PB temporary folder in it. This will significantly speed up the compilation and reduce the wear of Flash memory.
Re: Path to the temporary PB folder
Posted: Tue Dec 14, 2021 10:14 pm
by idle
I think you should be able to do that with a config file or temporarily from a script
https://www.hellojona.com/2017/06/creat ... erry-pi-3/
For a PI 3 as root
mkdir /var/tmp
edit /etc/fstab
tmpfs /var/tmp tmpfs nodev, nosuid, size=512M 0 0
then mount and check that it worked
mount -a
df -h
Re: Path to the temporary PB folder
Posted: Wed Dec 15, 2021 12:51 am
by BarryG
+1 for User_Russian's request. I don't like to compile to the source folder, and I hate compiling to %TEMP% because I have to white-list PureBasic's temp exe in there. It should be a 5-minute job to add a setting where we specify the temp path.
Re: Path to the temporary PB folder
Posted: Wed Dec 15, 2021 8:57 am
by User_Russian
idle wrote: Tue Dec 14, 2021 10:14 pm
I think you should be able to do that with a config file or temporarily from a script
This makes sense when there is a lot of RAM. If the board only has 512MB of RAM, there is no memory for the entire tmp folder. For PB, 80 MB disk frames are sufficient. This is not enough for tmp.
Re: Path to the temporary PB folder
Posted: Wed Dec 15, 2021 9:42 am
by idle
If that's no good, surely it can be done via a script that overrides the environment path for tmp when you launch pb?
Re: Path to the temporary PB folder
Posted: Wed Dec 15, 2021 10:31 am
by User_Russian
How to override the path for PB?
If you override the TMP system folder, that is, not an option. PB can be launched a lot of time (for example, 10 hours), and periodically compile. During this time, other programs and OS will also use the TMP folder. Memory is not enough.
Re: Path to the temporary PB folder
Posted: Mon Dec 20, 2021 8:44 am
by idle
Ive tried it with tmpfs of 256kb on a PI 3 with 1 gb ram and it seems to work ok
Re: Path to the temporary PB folder
Posted: Mon Dec 20, 2021 3:44 pm
by skywalk
This is an old request and I would appreciate it.
Whitelisting %temp% is not allowed or recommended.
Re: Path to the temporary PB folder
Posted: Mon Dec 20, 2021 7:54 pm
by mk-soft
PB uses the path "/tmp" and not "/var/tmp".
So you have to change the path in fstab
"tmpfs /tmp tmpfs nodev,nosuid,size=512M 0 0"
I hope that the size is enough because also other programs use the path "/tmp".
After the start only 1% of it is filled with the "/tmp" path
Much then occupied by the path "/tmp", you can then also see file manager
Re: Path to the temporary PB folder
Posted: Mon Dec 20, 2021 11:01 pm
by idle
Thanks mk-soft and PB ignores $TMPDIR too.