Log In  

Hello,

I've noticed if we save a file by typing two or more spaces before its name, for example "save mygame.p8" instead of "save mygame.p8", then it will create a new file with extra spaces before the first letter, which may lead to confusion if you reload an older file without the extra space.
In my opinion, spaces should be separators between commands (like on an Unix shell), not included in the filename. In the case some people want to have spaces in their filenames, this should be allowed only with extra "" for example:

save "my game.p8"

and not

save my game.p8

P#22342 2016-06-05 09:10 ( Edited 2016-06-07 13:07)

Can you clarify "extra spaces before the first letter"? I can't reproduce this on Mac OS X (10.11.5, Pico-8 0.1.6). I agree that the command parsing doesn't match most command shells (and I wouldn't defend that necessarily), but it's symmetric as far as I can tell:

save my game.p8

creates a file named "my game.p8".

load my game.p8

loads the file.

The general behavior is that all commands are built-in functions, and when you type a command without parens followed by a space at the Pico-8 command prompt, the rest of the line is passed to the command as a string argument. Even this behavior is way too finicky for my taste:

> cd<enter>
(prints the current working directory)
> cd<space><enter>
syntax error
> cd<space><space><enter>
directory not found

(Not all functions behave this way, only a short list of whitelisted commands.)

I have mixed feelings about the command prompt. I like the throwback feel, and I generally like command prompts as long as they implement a minimum feature set (where Pico-8 falls short at the moment). I wonder if Pico-8 would be better served by a file manager UI and a real Lua REPL/debugging UI as separate features. But it's more difficult to evolve a UI than just add new arbitrary commands, and it's probably good enough.

P#22349 2016-06-05 13:18 ( Edited 2016-06-05 17:18)

[quote]
save my game.p8

creates a file named "my game.p8".

    load my game.p8

[/quote]

yeah, probably it does. It's rather ok, maybe a bit misleading but the real problem is if you add an extra space before the filename. Then the file will be " myfile.p8" instead of "myfile.p8". So if you have in your carts:

"mygame1.p8"
"mygame2.p8"

you work on "mygame2.p8", you type by error "save mygame2.p8" (notice the double space) instead of "save mygame2.p8", then next time you type "load mygame2.p8" and you'll miss the changes made in " mygame2.p8". And you get this in the carts folder (which you won't probably check too often):

"mygame1.p8"
"mygame2.p8"
" mygame2.p8"

(extra quoting marks for readability only)

I noticed there was a problem with that because sometimes I type "load mygame1" with extraspace then it says "could not load".

P#22392 2016-06-06 04:18 ( Edited 2016-06-06 08:18)

Ah, 100% agreed, that's bad. The command parser should strip leading and trailing spaces from the bareword and support quoted strings.

P#22414 2016-06-06 12:08 ( Edited 2016-06-06 16:08)

@dddaaannn: and not only you can do

cd<space><space><enter>

as you said, but you can also create directories named " "

mkdir<space><space><enter>

which are a pain to remove on Windows.

P#22453 2016-06-07 09:07 ( Edited 2016-06-07 14:51)

[Please log in to post a comment]

Follow Lexaloffle:        
Generated 2021-08-05 20:35:22 | 0.014s | Q:14