Creating a temporary directory (/tmp)

Updated: April 19, 2023

You can use your buildfile to create a temporary directory in the RAM shared memory “filesystem”.

To create the /tmp directory in the RAM /dev/shmem “filesystem”, you can include the following instruction in your buildfile:

[type=link] /tmp = /dev/shmem

This instruction sets /tmp as a symbolic link in the process manager's pathname table; this symbolic link points to the /dev/shmem directory.

Since the /dev/shmem directory is the location where shared memory objects are stored, this link effectively lets you create files in the RAM “filesystem” (see /dev/shmem RAM “filesystem” in the QNX Neutrino User's Guide).

Note:

Place the line with the link attribute ([type=link]) outside the script file and the boot file. For example:

[image=0x1400000]
[virtual=x86_64,kpi +compress] boot = {
    ...
}

[+script] startup-script = {
    ...
}

[type=link] /tmp=/dev/shmem