V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
Yc1992
V2EX  ›  Python

求助! mac 下所有程序使用的临时目录都指向/tmp

  •  
  •   Yc1992 ·
    bufrr · 2016-05-02 17:57:32 +08:00 · 2548 次点击
    这是一个创建于 2929 天前的主题,其中的信息可能已经有所发展或是发生改变。

    $brew install hadoop

    Error: No such file or directory - /tmp/homebrew20160502-5838-133epnv

    开启其他程序,总显示 tmp 目录不存在。

    事实上/tmp目录并不存在 tmp -> private/tmp

    mkdir /tmp

    mkdir: /tmp: File exists

    cd /tmp

    cd: no such file or directory: /tmp

    $env

    TMPDIR=/var/folders/8l/mn3whrl17sx2kyfsrkklfczr0000gn/T/

    误删了 home 目录下的所有 .*

    文件之后就变成这样了

    google 了半天没到到解决方法,求助一下大家。是哪个环境变量的问题吗?

    6 条回复    2016-05-03 18:23:05 +08:00
    pimin
        1
    pimin  
       2016-05-02 18:07:46 +08:00 via Android
    export HOMEBREW_TEMP="/usr/local/Cellar/"
    这句写到.bash_profile 试试
    wwwjfy
        2
    wwwjfy  
       2016-05-02 18:13:12 +08:00
    可以看看 `mktemp` 和 `$TMPDIR` 有没有问题
    Yc1992
        3
    Yc1992  
    OP
       2016-05-02 18:53:03 +08:00
    @pimin brew
    可以了 但是不知道其他 tmp 的问题是怎么回事。。。
    Yc1992
        4
    Yc1992  
    OP
       2016-05-02 18:54:22 +08:00
    @wwwjfy 都没问题啊~
    chzyer
        5
    chzyer  
       2016-05-03 16:05:58 +08:00   ❤️ 1
    你手动给 /tmp 建个软链到 /private/tmp 就可以了吧?
    Yc1992
        6
    Yc1992  
    OP
       2016-05-03 18:23:05 +08:00
    @chzyer 事实上是不小心删掉了 /private/var/tmp 跟同事的 mac 对比后才发现的 新建文件夹 给权限 就好了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   978 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 20:21 · PVG 04:21 · LAX 13:21 · JFK 16:21
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.