How to browse the directories of an external drive even when it is not attached

applescriptfinder

I am new to this. Is there any script that analyzes and creates an XML files the entire file structure of any external hard drive that is connected to the computer,including all the fill names in all the folders.And i want to store the xml document to the computer even after removing the hard drive. Can anyone help me by giving an idea or a tutorial or link which will me?

Thank you

Best Answer

Based on the clarifications in the comments, you can do the following:

Create an index file

find /Volumes/YOUR-EXTERNAL-DRIVE -print > ~/YOUR-EXTERNAL-DRIVE-index.txt

This will list all files/folders on the external drive and store the result in your home folder.

Search for a file

grep THE-NAME-YOU-ARE-LOOKING-FOR ~/YOUR-EXTERNAL-DRIVE-index.txt

Partial names will work as well (and the external drive must not be attached for the search).