Menu

Changing startup directory

2017-03-14
2017-03-15
  • Daniel Stritt

    Daniel Stritt - 2017-03-14

    Hello, when using windows I can change the directory that PC-BASIC starts up in by changing the shortcut properties that I use to start it, but under linux I am not sure how to change the current directory on startup so I don't have to typr chdir "basic" every time I start the program since I tend to forget to do it.

    Thanks,
    Daniel

     
  • Daniel Stritt

    Daniel Stritt - 2017-03-14

    Ok I found a solution, but it may not be the best. I just created a launcher to point to a shell script, then in that script I changed directory and called pcbasic. I had to update filename references in pcbasic.ini because the current directory was changed, but it worked.

     
  • Rob Hagemans

    Rob Hagemans - 2017-03-14

    Hi Daniel, to be honest, changing a program's working directory is not something I've often tried to do in Linux. Your shell script solution seems workable. Other ways would depend on the details of your desktop environment so you may need to consult their documentation.

    I don't know the details of your use case - however, if you're doing this mainly in order to change where files are saved/loaded, then an easier way is to change the mount point for PC-BASIC's Z: drive with the mount= option in PCBASIC.INI (see http://robhagemans.github.io/pcbasic/doc/#--mount)

    For example, if your BASIC files are always under /home/me/basic you'd include the following line in PCBASIC.INI:

    mount=Z:/home/me/basic
    

    Hope this helps,
    Rob

     
  • Daniel Stritt

    Daniel Stritt - 2017-03-15

    Actually, yes, that's why I was trying to change the current dir. I wanted the basic programs in a different directory than my home folder. Thanks for the advice!

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.