Menu

Accessing files over a network?

Anonymous
2015-06-22
2015-06-24
  • Anonymous

    Anonymous - 2015-06-22

    First of all, you are a life saver. I have 50+ GW-Basic programs written over the years which were facing extinction until you wrote PC-Basic. Thanks and a huge sigh of relief!

    So far, everything works perfectly, even the graphics on screen 9, which don't always work on some Win XP graphics cards.

    However, I have a couple of database programs which can currently (GW-Basic + Win XP) access files over an Ethernet network from another PC.

    The path in GW-Basic is:" \[target PC][directory]\ " but this returns "file not found" in PC-Basic. Is there any (simple) way to 'escape the box' and access other directories higher up the tree?

    Hope this makes sense. I'm not a programmer, just someone who bodges code to save myself tedious brainwork.

     
  • Rob Hagemans

    Rob Hagemans - 2015-06-22

    Hi, great that you find PC-BASIC useful! 50+ programs is a good stash to test out all the features -- do let me know if you run into things that don't work correctly.

    Windows network paths as you describe them (let's say \\HUMMINGBIRD\Documents) are not directly supported but I think you can make it work if you mount the network drive to a GW-BASIC disk drive letter and adjust your BASIC code to use that drive letter.

    You could try using the PCBASIC.INI option
    mount=N:\\HUMMINGBIRD\Documents

    and then see if you can access the files at \\HUMMINGBIRD\Documents from PC-BASIC through FILES "N:"

    I'm actually not sure if this will work, but it's worth a try. If it fails, you could map the network location as a Windows drive letter (using Map Network Drive on XP, not sure if it's called differently on current Windows versions) and then mount that drive to a PC-BASIC drive letter. Note that PC-BASIC doesn't directly recognise Windows drives unless you mount them (which is a bit confusing but I think it's the right thing to do).

    So if you've mapped \\HUMMINGBIRD\Documents to Windows drive E:, the option
    mount=N:E: would make it available as N: under PC-BASIC. If you want it as the same letter, you still need a mount option, e.g. mount=E:E:. Alternatively, you could use the option map-drives=True to assign all Windows drives to the same letters in PC-BASIC; careful with this as it may give your BASIC programs access to things you didn't want it to.

    Note that if you're running PC_BASIC from the command prompt, you can give these options without having to edit PCBASIC.INI; just precede them with two dashes. E.g.
    C:\Program Files\PC-BASIC\pcbasic --mount=N:E:

    Hope this helps, let me know if it works!
    Rob

     
  • Anonymous

    Anonymous - 2015-06-22

    Thanks for the quick reply. I'm not sure how Win 7 & 8 map network drives so it might take me a bit of time. I will have a go and report back.

    PS- I haven't tried it yet, but if I can also get PC-Basic to run SoundBlaster utilities through Dosshell my world would be complete!

     
  • Rob Hagemans

    Rob Hagemans - 2015-06-22

    By default, the SHELL command is disabled.

    You can enable it (at least in the current version) using shell=native which will connect to a CMD shell. In other words, if the utility doesn't run in a Windows CMD shell, it will not run in PC-BASIC either. You can try running the program in DOSBox instead.

     
  • Anonymous

    Anonymous - 2015-06-24

    Hi Rob. I thought I ought to report back. Unfortunately I haven't tried your suggestions yet but I may have accidentally found a workaround.

    After making the directory containing pc-basic.exe & the databases in PC1 fully shareable in Windows, I created a desktop shortcut to that directory from the other networked PC (PC2). Clicking on the shortcut in PC2 runs pc-basic.exe on PC1 and gives read & write access to files in the PC1 directory (and subdirectories).

    I wasn't sure about running the same exe file from 2 places simultaneously so I created a copy of pc-basic.exe in the PC1 directory, called 'pc-basic2.exe', and used it as a target for the PC2 shortcut.

    When running 'pc-basic.exe' from PC1 and 'pc-basic2.exe' from PC2 I can run the same 'READDB.BAS' program in PC1 simultaneously from both PCs and access the same database in PC1 with no conflicts (so far).

    Sorry it's a long-winded explanation. Hope it makes sense.

    Thanks for your help though. Even though I didn't use your suggestions it gave me the inspiration to start experimenting.

    I will have to find time to experiment with SHELL later!

    All the best,
    Nick

     
  • Rob Hagemans

    Rob Hagemans - 2015-06-24

    Hi Nick,

    Well, I can't say I quite understand what you're doing but I'm glad it's working :)
    In principle you should be able to run the same EXE more than once, either on the same or on different computers.

    Rob