How can I make OS X recognize drive letters?

后端 未结 7 1593
长情又很酷
长情又很酷 2021-01-20 23:11

I know. Heresy. But I\'m in a bind. I have a lot of config files that use absolute path names, which creates an incompatibility between OS X and Windows. If I can get OS X (

7条回答
  •  别那么骄傲
    2021-01-21 00:07

    Honestly, don't hard-code absolute paths in a program, even for a single-platform app. Do the correct thing.

    The following is my wrong solution, saved to remind myself not to repeat giving a misdirected advice ... shame on me.

    Just create a symbolic link named Q: just at the root directory / to / itself.

    $ cd /
    $ ln -s / Q:
    $ ln -s / S:
    

    You might need to use sudo. Then, at the start of your program, just chdir to /.

    If you don't want Q: and S: to show up in the Finder, perform

    $ /Developer/Tools/SetFile -P -a V Q:
    $ /Developer/Tools/SetFile -P -a V S:
    

    which set the invisible-to-the-Finder bit of the files.

提交回复
热议问题