Which gtk method I have to use to get temporary path in Ubuntu?

前端 未结 5 1495
借酒劲吻你
借酒劲吻你 2021-01-03 00:52

How can I get the temporary directory path in Ubuntu?

5条回答
  •  醉话见心
    2021-01-03 00:58

    I looked at how Python does this, and there doesn't seem to be any specific UNIX interface to do so.

    They just try, in sequence:

    1. The environment variables TMPDIR, TEMP, and TMP
    2. /tmp
    3. /var/tmp
    4. /usr/tmp

    Given that Python was written by people a lot smarter than I am, I'd be willing to bet this is probably the best you can do.

提交回复
热议问题