Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I resolve an alias in Mac OS X?

Status
Not open for further replies.

georgeocrawford

Technical User
Aug 12, 2002
111
GB
Hi,

Running OS X 10.3.

I've written a php script, including a few shell commands, which searches a directory recursively, and record the paths of each file and directory it comes across in a MySQL database.

This enables me to generate a web-based 'directory browser', with each folder displayed as a hyperlink to the contents of that directory (similar to the indexing system Apache can employ when there is no index.html file in a directory, for example).

I understand from my research that OS X's aliases (i.e. the Finder-based shortcut, not symbolic links) are a complicated affair. Ideally, I would like my script to detect an alias during the scan, and add a note into the database that this folder should actually link to the contents of another folder.

How can I:

a) detect that a file is an ailas?
b) resolve the full path of the alias's target file/directory?

I need to be able to do this from within PHP, but using shell calls I can do anything that could normally be typed into the Terminal.

Any help would be appreciated!

______________________

George
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top