Jump to content
IGNORED

FastBasic 4.6 cross-compiler and paths containing spaces in Windows


Recommended Posts

Hi all, something in the FastBasic 4.6 cross compiler for Windows doesn't like quoted paths with "embedded spaces" and such. This can be a pita to avoid with some cloud storages like Google Drive:

 

G:\My Drive>G:Projects\FastBasic46\fb "G:Projects\My crap\Matrix3.bas"
BAS compile 'G:Projects\My crap\Matrix3.bas' to 'G:Projects\My crap\Matrix3.asm'
ASM assemble 'G:Projects\My crap\Matrix3.asm' to 'G:Projects\My crap\Matrix3.o'
ca65: Don't know what to do with 'crap\Matrix3.lst'
fastbasic: can't assemble file


G:\My Drive>cd "Projects\My crap"

G:\My Drive\Projects\My crap>"G:\My Drive\Projects\FastBasic46\fb" Matrix3.bas
BAS compile 'Matrix3.bas' to 'Matrix3.asm'
ASM assemble 'Matrix3.asm' to 'Matrix3.o'
ca65: Don't know what to do with 'Matrix3.asm'
fastbasic: can't assemble file


G:\My Drive\Projects\My crap>"G:..\FastBasic46\fb" Matrix3.bas
BAS compile 'Matrix3.bas' to 'Matrix3.asm'
ASM assemble 'Matrix3.asm' to 'Matrix3.o'
LINK Matrix3.xex

G:\My Drive\Projects\My crap>

 

Link to comment
Share on other sites

6 hours ago, danwinslow said:

Looks like whatever is building the args of the CA65 call is not (re?) enclosing it in quotes. Just a guess. Can you tell it to show all commands as they are being run?

 

Unfortunately I don't see any such options. The fb compiler has an -X option to pass things like --debug or --verbose through to the assembler, but neither of those do what I hoped they would

 

5 hours ago, sanny said:

Spaces in path name are anyway "evil"... 🙂

1 hour ago, danwinslow said:

Indeed. As is the weird behavior of displaying case in file names but it not actually mattering to the file system.

 

Both are almost impossible to avoid altogether anymore. And then there are "exotic" Unicode characters that sometimes show up in file/path names (shudder)

Link to comment
Share on other sites

Hi!

On 3/8/2024 at 1:09 AM, yetanothertroll said:

Both are almost impossible to avoid altogether anymore. And then there are "exotic" Unicode characters that sometimes show up in file/path names (shudder)

 

Problem is windows command line processing: there is no way to pass filenames to a windows command line directly; it does not support the concept of command line "arguments", only of a single command line.

 

I followed the advice of https://learn.microsoft.com/en-us/cpp/c-runtime-library/spawn-wspawn-functions?view=msvc-170#arguments-for-the-spawned-process and enclosed parameters with spaces in double quotes, this seems to work.

 

And released a new beta version, attached is the ATR plus windows and linux cross-compiler, all other version over github: https://github.com/dmsc/fastbasic/releases/tag/v4.7-beta1

 

Changes from v4.6:

 

Language changes:

  • Adds SIO statement
  • Adds Fujinet support: NOPEN, NCLOSE, NSTATUS and NGET statements, see "nc" and "mastodon" examples.
  • Support ADR for floating point variables.
  • Adds %() function.
  • You can now omit parentheses in string functions, like LEN "X" instead of LEN("X")

Fixes:

  • Fixes compiling long DLI statements.
  • Fixes for AND/OR mixing bools and integer operands.
  • Fixes chaining COLOR()  and RTAB() in PRINT statements.

Cross Compiler:

  • Fixes on Windows cross compiler for filenames with spaces or Unicode characters.
  • Better error messages:
    • show variable names in errors,
    • ASCII art with the error location,
    • shows errors on missing ending of loops or ifs.

 

Have Fun!

 

fastbasic-v4.7-beta1-win32.zip fastbasic-v4.7-beta1.atr fastbasic-v4.7-beta1-linux64.zip

Edited by dmsc
  • Like 4
  • Thanks 3
Link to comment
Share on other sites

8 hours ago, dmsc said:

Hi!

 

Problem is windows command line processing: there is no way to pass filenames to a windows command line directly; it does not support the concept of command line "arguments", only of a single command line.

 

I followed the advice of https://learn.microsoft.com/en-us/cpp/c-runtime-library/spawn-wspawn-functions?view=msvc-170#arguments-for-the-spawned-process and enclosed parameters with spaces in double quotes, this seems to work.

 

And released a new beta version, attached is the ATR plus windows and linux cross-compiler, all other version over github: https://github.com/dmsc/fastbasic/releases/tag/v4.7-beta1

 

Changes from v4.6:

 

Language changes:

  • Adds SIO statement
  • Adds Fujinet support: NOPEN, NCLOSE, NSTATUS and NGET statements, see "nc" and "mastodon" examples.
  • Support ADR for floating point variables.
  • Adds %() function.
  • You can now omit parentheses in string functions, like LEN "X" instead of LEN("X")

Fixes:

  • Fixes compiling long DLI statements.
  • Fixes for AND/OR mixing bools and integer operands.
  • Fixes chaining COLOR()  and RTAB() in PRINT statements.

Cross Compiler:

  • Fixes on Windows cross compiler for filenames with spaces or Unicode characters.
  • Better error messages:
    • show variable names in errors,
    • ASCII art with the error location,
    • shows errors on missing ending of loops or ifs.

 

Have Fun!

 

fastbasic-v4.7-beta1-win32.zip 2.05 MB · 1 download fastbasic-v4.7-beta1.atr 179.64 kB · 2 downloads fastbasic-v4.7-beta1-linux64.zip 1.64 MB · 2 downloads

 

Noice, thanks! Would it be easier to simply enclose all paths and file names in double quotes, without bothering to check for spaces, Unicode, or other such evil? It shouldn't be an error to pass "normal" paths and filenames this way, and this way there should be no nasty surprises if a path contains an odd character you didn't test for.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...