Hello all. I am writing a program, and I for some reason am having trouble doing the following cleanly. One of the inputs to this program is a directory path. I do a ftw on this path, and have to output filenames that match certain paramaters.
The problem is, the filenames are absolute i.e. relative to /. I need filesnames relative to the input path. The problem is this program follows symbolic links, and should output symbolic paths as if they were directories.
This is probably a common enough unix problem that there is a function to do it, and if there is not, it is a common enough task I'm sure someone has a chunk of code lying around to do it. If not though, what is a clean way to do it? The symbolic links part is what really is turning my code to do this into a mess.
-Chu
The problem is, the filenames are absolute i.e. relative to /. I need filesnames relative to the input path. The problem is this program follows symbolic links, and should output symbolic paths as if they were directories.
This is probably a common enough unix problem that there is a function to do it, and if there is not, it is a common enough task I'm sure someone has a chunk of code lying around to do it. If not though, what is a clean way to do it? The symbolic links part is what really is turning my code to do this into a mess.
-Chu
