Posted to tcl by zoro2 at Wed Oct 17 09:13:33 GMT 2012view raw

  1. % exec ls -l _temp/ln/d
  2. total 0
  3. -rw-r--r-- 1 zoro zoro 0 2012-10-17 11:08 f
  4. lrwxrwxrwx 1 zoro zoro 4 2012-10-17 11:05 l -> ../f
  5. lrwxrwxrwx 1 zoro zoro 1 2012-10-17 11:10 l2 -> f
  6.  
  7. % file normalize _temp/ln/d/l/../../f
  8. /tmp/_temp/ln/d/f
  9.  
  10. % file normalize _temp/ln/d/l2/../../f
  11. /tmp/_temp/ln/f
  12.  
  13. % file normalize _temp/ln/d/f/../../f
  14. /tmp/_temp/ln/f
  15.  
  16. Notice that it only reports incorrect path for symlink that points to ../f.