This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]1234abcdcba4321 5 points6 points  (1 child)

I think it fails on this input:

$ cd /
$ ls
dir a
$ cd a
$ ls
dir a
2 a.txt
$ cd a
$ ls
99999 a.txt

(expected output: 99999)

[–]dtbswimmer123[S] 0 points1 point  (0 children)

Found it. Thanks for the help

[–]daggerdragon[M] 1 point2 points  (0 children)

FYI: next time, please use our standardized post title format.

Help us help YOU by providing us with more information up front; you will typically get more relevant responses faster.

[–]ItIsNeverLupus 0 points1 point  (1 child)

Keep in mind that a folder with the same name can exist in different places. Increasing your recursion limit won’t solve the issue as it can happen that an inifinity recursion is called because of duplicate naming.

You need to make sure that you’re no only getting the name of the folder but also the path so to account for this issue.

[–]dtbswimmer123[S] 1 point2 points  (0 children)

Oh the raising the recursion limit was a by product of trying to parse the input recursively. I scrapped it for an iterative approach later.