georgeocrawford
Technical User
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
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