Feature #3544 2007-07-05 08:30

jazzer

find file by filename with no path info

Please, could anyone change cbProject::GetFileByFilename to return correct path to the file (with all subdirectories) when only filename is given.

This is needed to support tools that give only filenames, with no path information.

Current C::B behaviour: if (path is absolute) open as is else open relative to the project root (i.e. "$project_root/$relative_path")

I'd like to extend this with an additional branch: if there is no such file in the project root, try to find the file in the project tree.

For example, if the file is /tmp/dir1/dir2/file.cpp and project root is /tmp, so: "/tmp/dir1/dir2/file.cpp" - absolute path, open as is; "dir1/dir2/file.cpp" - relative path, prepend project root (it will give "/tmp/dir1/dir2/file.cpp") and open; "dir2/file.cpp" - relative path, prepend project root (it will give "/tmp/dir2/file.cpp") and try to open - failed, try to find this in the project tree (should be very fast, as the project tree is in memory), find in dir1 and open; "file.cpp" - just a file name, prepend project root (it will give "file.cpp") and try to open - failed, try to find this in the project tree (again, should be very fast), find in dir1/dir2 and open.

Of course, there is a problem with duplicates, but when you have just a file name - you have no better choice. Of course, various smart techniques can be used to distinguish between different files with the same name, but it's not for the near future. For now it's enough just show the list of possibilities and let user to decide.

What do you think? Is it possible? This would be a great help to all people who use complicated build procedures and strange development tools and tries to tie them with C::B.

references: https://developer.berlios.de/bugs/?func=detailbug&group_id=5358&bug_id=11207 https://developer.berlios.de/bugs/?func=detailbug&group_id=5358&bug_id=11208

Category
Interface
Status
Open
Close date
 
Assigned to