Results of findfile() are inconsistent:
The results seem consistent to me.
/home/mikolaj/a /home/mikolaj/1/b /home/mikolaj/2/c /home/mikolaj/3/d /home/mikolaj/3/4/e 1. We are in /home/mikolaj:: echo findifile("b", "1;") 1/b
You are giving findfile() a relative path to search, so it is returning a relative result.
2. We are in /home/mikolaj/2:: echo findifile("b", "/home/mikolaj/1;") /home/mikolaj/1/b
You are giving findfile() an absolute path to seach, so it is returning an absolute result.
3. We are in /home/mikolaj/3/4:: echo findifile("d", "/home/mikolaj/3/4;") /home/mikolaj/3/d
Once again you supply an absolute path, so it returns an absolute result. If you need to expand a relative result to its absolute path or strip off portions of an absolute result, you can always use fnamemodify(). -- eric