RAM drive for compiling - is there such a thing?

后端 未结 18 2113
既然无缘
既然无缘 2020-12-02 08:16

An answer (see below) to one of the questions right here on Stack Overflow gave me an idea for a great little piece of software that could be in

18条回答
  •  旧时难觅i
    2020-12-02 08:34

    There are plenty RAMDrives around, use one of those. Sorry, that would be reckless.

    Only if you work entirely in the RAM disc, which is silly..

    Psuedo-ish shell script, ramMake:

    # setup locations
    $ramdrive = /Volumes/ramspace
    $project = $HOME/code/someproject
    
    # ..create ram drive..
    
    # sync project directory to RAM drive
    rsync -av $project $ramdrive
    
    # build
    cd $ramdrive
    make
    
    #optional, copy the built data to the project directory:
    rsync $ramdrive/build $project/build
    

    That said, your compiler can possibly do this with no additional scripts.. Just change your build output location to a RAM disc, for example in Xcode, it's under Preferences, Building, "Place Build Products in:" and "Place Intermediate Build Files in:".

提交回复
热议问题