Jump to content




[Request] Windows Tree Command


  • You cannot reply to this topic
2 replies to this topic

#1 legomaniack

  • New Members
  • 7 posts

Posted 07 February 2012 - 11:00 PM

I was wondering, if you could have a program that visually lists the file structure, like the windows command "tree"

for example, if i have Folder1 with File 1 in it, and Folder 2 with Folder 3 and file 2 in it, and Folder 3 has file 3 in it, and file 4 is back in the hdd.

[ VEIW ATTACHED TXT FILE ]

I think this would be useful, as it helps some to visualize file structure.

EDIT: Ok, so its possible, but i don't have enough lua knowledge to make it. Anyone?

Attached Files



#2 Casper7526

    OG of CC

  • Members
  • 362 posts

Posted 08 February 2012 - 12:00 AM

yes that's certainly possible, the "ls" command returns a table of data, and then you would loop through that table of data and add appropriate markings based on if the table contains folders or files.

#3 Espen

    Curious Explorer

  • Members
  • 708 posts

Posted 08 February 2012 - 01:37 PM

I've played around a little for curiosity's sake.
As far as I've tested, basic functionality should work. At the moment you can't tell it the maximum level of traversal.
That means it traverses EVERY directory it finds, so use with caution (or terminate it with CTRL+T :P/>).
Code: http://pastebin.com/bggiSgmc

I'm not happy with the handling of the command arguments, I've just hastily hacked that together at the end. So just ignore that for now.^^
For help on how to use it type:
tree -h





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users