Path to the temporary PB folder

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User_Russian
Addict
Addict
Posts: 1518
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Path to the temporary PB folder

Post 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.
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Path to the temporary PB folder

Post 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
BarryG
Addict
Addict
Posts: 4123
Joined: Thu Apr 18, 2019 8:17 am

Re: Path to the temporary PB folder

Post 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.
User_Russian
Addict
Addict
Posts: 1518
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: Path to the temporary PB folder

Post 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.
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Path to the temporary PB folder

Post 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?
User_Russian
Addict
Addict
Posts: 1518
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: Path to the temporary PB folder

Post 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.
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Path to the temporary PB folder

Post by idle »

Ive tried it with tmpfs of 256kb on a PI 3 with 1 gb ram and it seems to work ok
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Path to the temporary PB folder

Post by skywalk »

This is an old request and I would appreciate it.
Whitelisting %temp% is not allowed or recommended.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
mk-soft
Always Here
Always Here
Posts: 6204
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Path to the temporary PB folder

Post 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
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Path to the temporary PB folder

Post by idle »

Thanks mk-soft and PB ignores $TMPDIR too.
Post Reply