This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
WolfDood's profile picture

Command crashes computer

Started by WolfDood, 30 July 2017 - 03:27 AM
WolfDood #1
Posted 30 July 2017 - 05:29 AM
Hey so I randomly typed in this:

> cd ....
and no matter what directory it was in, it seemed to go in to this non-existent folder,
I could press enter a couple of times and it would skip to the next line but when I pressed a key,
e.g: J
It would then shutdown. Anyone know why this happens?

Screenshots:

Bomb Bloke #2
Posted 30 July 2017 - 07:09 AM
It's because any amount of periods constitutes a valid directory name under Windows (or NTFS, I'm not entirely sure where the behaviour is specifically defined). Two dots stands for the parent directory, whereas any other quantity refers to the current directory.

ComputerCraft fails to recognise this: it knows …. is a valid directory (because if it asks Java's filesystem methods they'll confirm that to be true), but it doesn't understand that it refers to the current directory, and so it'll switch "there" - leading to death by shell autocomplete once you try to type anything further.

I bugged Dan to fix it once or twice but I'm not entirely sure he understood the problem.