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

Directory anomaly

Started by Mc Fow1er, 24 August 2014 - 03:01 AM
Mc Fow1er #1
Posted 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
Rectar2 #2
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("...")
Mc Fow1er #3
Posted 24 August 2014 - 05:21 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("...")
Ok, I'll try that.
Result:

lua> fs.isDir("...")
true
Ok so it's a dir but where is it physically?????
Edited on 24 August 2014 - 03:22 AM
Rectar2 #4
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()
Mc Fow1er #5
Posted 24 August 2014 - 05:35 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()
So basically it's a dir that is in the mod itself? Also that have me the error

Expected string
I also added ("…") and nothing appeared below but empty space.
Edited on 24 August 2014 - 03:38 AM
Rectar2 #6
Posted 24 August 2014 - 05:48 AM
So basically it's a dir that is in the mod itself? Also that have me the error
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.


Also that have me the error

Expected string
My bad, use
fs.list("")
Edited on 24 August 2014 - 03:49 AM
Mc Fow1er #7
Posted 24 August 2014 - 06:11 AM
So basically it's a dir that is in the mod itself? Also that have me the error
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.


Also that have me the error

Expected string
My bad, use
fs.list("")
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

lua> ("")
{
   "HDD",
   "iim",
   "ink",
   "Installers",
   "lgrub.sys",
   "lightshot",
   "nsh",
   "os",
   "pgps",
   "startup",
   "thunderhawk",
   "UltimateDoorLock",
   "rom",
}
Rectar2 #8
Posted 24 August 2014 - 06:18 AM
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
Did cd … do anything on this computer, though?
Mc Fow1er #9
Posted 24 August 2014 - 06:32 AM
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
Did cd … do anything on this computer, though?
I tested cd … on everything it still sent me to the dir. Clean or heavily OSed.
Edited on 24 August 2014 - 04:44 AM
Rectar2 #10
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?
Mc Fow1er #11
Posted 24 August 2014 - 07:54 AM
Very odd… Are you using any resource packs that have code in them, or any mods that might change anything in CC?
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.
Bomb Bloke #12
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.
Mc Fow1er #13
Posted 24 August 2014 - 09:20 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.
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>
Mr. Bateman #14
Posted 24 August 2014 - 01:31 PM

lua> ("")
{
   ...
   "lgrub.sys",
   ...
}
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.
Mc Fow1er #15
Posted 24 August 2014 - 01:54 PM

lua> ("")
{
   ...
   "lgrub.sys",
   ...
}
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.
I did it works on every computer I tried even on a fresh computer.
Bomb Bloke #16
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.
Mc Fow1er #17
Posted 24 August 2014 - 05:11 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.
So basically this is completely and utterly normal?
Bomb Bloke #18
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.
Mc Fow1er #19
Posted 25 August 2014 - 03:00 PM
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.
So it was just a bit of code that got past.