LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-21-2006, 05:18 PM   #1
unholy
Member
 
Registered: Sep 2003
Location: Eire
Distribution: Ubuntu 7.10
Posts: 344

Rep: Reputation: 30
Want to make a structured list of my filesystem


I want to send a list of the contents of my home folder to a friend. Since this stuff has a 'tree' type heirarchy, I thought an xml file would be the best way to represent my filesystem. Each directory could be collapsable and the entries at each node could be my files.

Is there a utility to do this, or something else that will give the same result. I just want him to be able to see the contents of my filesystem from what ever pc I mail him this attachment to.

Thanks for reading!

unholy
 
Old 09-21-2006, 05:35 PM   #2
Vgui
Member
 
Registered: Apr 2005
Location: Canada
Distribution: Slackware
Posts: 496

Rep: Reputation: 31
As a base you can use either:
Code:
ls -lR /home/whoever/
tree /home/whoever/
Mix up the switches as needed. You could pipe it into a file, and write a script to wrap each line in xml as needed, or just pass it around as a text file.
 
Old 09-21-2006, 05:56 PM   #3
unholy
Member
 
Registered: Sep 2003
Location: Eire
Distribution: Ubuntu 7.10
Posts: 344

Original Poster
Rep: Reputation: 30
Thanks Vgui, that did the job. I don't know how to get as far as putting that output to xml, but the tree view will do.

Regards,
unholy
 
Old 09-21-2006, 06:11 PM   #4
Vgui
Member
 
Registered: Apr 2005
Location: Canada
Distribution: Slackware
Posts: 496

Rep: Reputation: 31
Glad to hear it.
Outputting to xml would basically just be a script that loops through the tree output and wraps it in tags. The problem is I'm not sure what tags you would use, or what header info would be needed to make it a valid xml file.
Another option would be just plain html, again wrapping it in tags (maybe an unordered list, or a table).

Just dumping it to a file is probably easiest though
 
Old 09-21-2006, 06:20 PM   #5
unholy
Member
 
Registered: Sep 2003
Location: Eire
Distribution: Ubuntu 7.10
Posts: 344

Original Poster
Rep: Reputation: 30
Yeah, I think I'll just stick with the text file for the sake of simplicity. I'll let my mate do the refining if he likes

Thanks again,
unholy
 
Old 09-21-2006, 06:24 PM   #6
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Take the output of ls -lR /home/whoever/ and pipe it through tee to get a text file:
ls -lR /home/whoever/ | tee tree.txt.

Then, enscript --language=html --output=tree.html tree.txt, to make a html out of the text file.

It still doesn't expand/collapse, but it gets part of the job done.

There are open source tools around to convert html to xml.

Last edited by bigrigdriver; 09-21-2006 at 06:27 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot List Contents of USB Filesystem eljefe7000 Linux - Hardware 4 05-23-2006 01:53 PM
whether to go for an Object oriented or structured approach in a web based system.... sachitha Programming 3 01-08-2006 12:12 PM
Make kernel see new filesystem froggo Red Hat 3 12-21-2005 09:14 AM
Structured Security Samba drummel *BSD 1 03-02-2005 09:04 AM
General Advice on keeping your files structured and clean. hamster Linux - Software 2 04-10-2003 10:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration