This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
Directory anomaly
Started by Mc Fow1er, 24 August 2014 - 03:01 AMPosted 24 August 2014 - 05:01 AM
So basically I typed "cd …" instead of "cd .." and I got sent to the dir *anydir*/… and I jsut tested if it was just … or if it was any amount of . above 3 and it works oddly enough, and any one explain this to me? as the dirs are write protected and contain nothing. Oh and you can't make the directories eather.
Edited on 24 August 2014 - 03:05 AM
Posted 24 August 2014 - 05:19 AM
It may have actually been a directory, but not visible as it begins with a dot. In the lua console, try typing
fs.isDir("...")
Posted 24 August 2014 - 05:21 AM
Ok, I'll try that.It may have actually been a directory, but not visible as it begins with a dot. In the lua console, try typingfs.isDir("...")
Result:
lua> fs.isDir("...")
true
Ok so it's a dir but where is it physically?????Edited on 24 August 2014 - 03:22 AM
Posted 24 August 2014 - 05:29 AM
It's like any other directory, but is hidden. Any directory with a dot at the beginning isn't shown with the ls command, but is otherwise completely normal and is stored like any other directory. If you want to see hidden directories, you'll have to use the Lua function
fs.list()
Posted 24 August 2014 - 05:35 AM
So basically it's a dir that is in the mod itself? Also that have me the errorIt's like any other directory, but is hidden. Any directory with a dot at the beginning isn't shown with the ls command, but is otherwise completely normal and is stored like any other directory. If you want to see hidden directories, you'll have to use the Lua functionfs.list()
Expected string
I also added ("…") and nothing appeared below but empty space.Edited on 24 August 2014 - 03:38 AM
Posted 24 August 2014 - 05:48 AM
No, it's just a folder that a program you used created. Any program can make one of these folders, and it works like normal. The only difference between these and regular folders is that they don't appear with the ls command.So basically it's a dir that is in the mod itself? Also that have me the error
My bad, useAlso that have me the errorExpected string
fs.list("")
Edited on 24 August 2014 - 03:49 AM
Posted 24 August 2014 - 06:11 AM
But I tested it on a completely fresh computer, nothing but the rom.No, it's just a folder that a program you used created. Any program can make one of these folders, and it works like normal. The only difference between these and regular folders is that they don't appear with the ls command.So basically it's a dir that is in the mod itself? Also that have me the errorMy bad, useAlso that have me the errorExpected string
fs.list("")
And that gave me all the items I have installed on my computer
lua> ("")
{
"HDD",
"iim",
"ink",
"Installers",
"lgrub.sys",
"lightshot",
"nsh",
"os",
"pgps",
"startup",
"thunderhawk",
"UltimateDoorLock",
"rom",
}
Posted 24 August 2014 - 06:18 AM
Did cd … do anything on this computer, though?But I tested it on a completely fresh computer, nothing but the rom.
And that gave me all the items I have installed on my computer
Posted 24 August 2014 - 06:32 AM
I tested cd … on everything it still sent me to the dir. Clean or heavily OSed.Did cd … do anything on this computer, though?But I tested it on a completely fresh computer, nothing but the rom.
And that gave me all the items I have installed on my computer
Edited on 24 August 2014 - 04:44 AM
Posted 24 August 2014 - 06:41 AM
Very odd… Are you using any resource packs that have code in them, or any mods that might change anything in CC?
Posted 24 August 2014 - 07:54 AM
No resourse packs although I am using quite a few peripherals and I tested it without them installed I still got the dir as well as looked through the folder and found nothing.Very odd… Are you using any resource packs that have code in them, or any mods that might change anything in CC?
Posted 24 August 2014 - 08:36 AM
I noticed this behaviour myself a few months back (in CC1.63, though I'd be surprised if that's the only build which does it). It doesn't matter what directory you're in, ComputerCraft for whatever reason always allows you to switch into an (apparently non-existent) "…" folder.
Posted 24 August 2014 - 09:20 AM
I actually tried to physically make the folder and it failed so I'm beyond confused as hell, as if you try set the name to … or … . it will revert it back to the original name. Though I think that this would be a that this useful place to store stuff if one could some how get it to be a dir or file as . is used as a directory placement and so if you named a folder in your computer to …. . it will merge the folder with the base one, I found this pretty cool but now I'm wondering if it would work in CC as well because this would be rather useful for merging system folders for an OS or program. Now because you can't have a file/folders name as only . s I'm wondering if it will still hide it as a …..<file/folder name here>I noticed this behaviour myself a few months back (in CC1.63, though I'd be surprised if that's the only build which does it). It doesn't matter what directory you're in, ComputerCraft for whatever reason always allows you to switch into an (apparently non-existent) "…" folder.
Posted 24 August 2014 - 01:31 PM
I see you're using my bootloader. Try doing the same command on another computer without it, because the way that LuaGRUB patches the fs functions is very hacky so I wouldn't be surprised if one or two of quirks like these pop up.lua> ("") { ... "lgrub.sys", ... }
Posted 24 August 2014 - 01:54 PM
I did it works on every computer I tried even on a fresh computer.I see you're using my bootloader. Try doing the same command on another computer without it, because the way that LuaGRUB patches the fs functions is very hacky so I wouldn't be surprised if one or two of quirks like these pop up.lua> ("") { ... "lgrub.sys", ... }
Posted 24 August 2014 - 02:55 PM
Checking into the technical side of things, fs.isDir reports any directory name consisting of just periods exists (which likely has more to do with the host environment than LuaJ itself - my Windows command prompt does acts much the same in regards to existence checks), so the cd command erroneously assumes it can change into any directory name consisting of just periods.
The issue is in the default shell and should be trivial for anyone to reproduce. Though at this point I'd be surprised if a third person suggesting "user error" without testing it doesn't come along anyway.
The issue is in the default shell and should be trivial for anyone to reproduce. Though at this point I'd be surprised if a third person suggesting "user error" without testing it doesn't come along anyway.
Posted 24 August 2014 - 05:11 PM
So basically this is completely and utterly normal?Checking into the technical side of things, fs.isDir reports any directory name consisting of just periods exists (which likely has more to do with the host environment than LuaJ itself - my Windows command prompt does acts much the same in regards to existence checks), so the cd command erroneously assumes it can change into any directory name consisting of just periods.
The issue is in the default shell and should be trivial for anyone to reproduce. Though at this point I'd be surprised if a third person suggesting "user error" without testing it doesn't come along anyway.
Posted 25 August 2014 - 02:39 AM
Yes and no. It's a bug available to all ComputerCraft users, if that's what you're asking. Said bug is triggered by someone overlooking a rather obscure filesystem behaviour.
Posted 25 August 2014 - 03:00 PM
So it was just a bit of code that got past.Yes and no. It's a bug available to all ComputerCraft users, if that's what you're asking. Said bug is triggered by someone overlooking a rather obscure filesystem behaviour.