[Qt-interest] Symbolic link real value?

Oliver.Knoll at comit.ch Oliver.Knoll at comit.ch
Tue Jul 28 17:35:51 CEST 2009


Pau Garcia i Quiles wrote on Tuesday, July 28, 2009 3:14 PM:

> ...
>> No, it does not:
>> 1. relative path does not need to contain '..'
> 
> You are right. Check for "./", ".\", etc too.

Also "this/is/relative" is a relative path (not a formally correct one, but still considered relative by most applications - just like /this/is/a/directory/ or /this/is/a/directory could both point to a directory (missing / in the end of the second path, which would actually indicate it is a file - still most applications get along with such an "incomplete" path - I think even the Qt API methods skip the last '/' of directory paths, but I might be mistaken here).

In other words, on Unix: "If the path starts with '/', it is absolute; relative else"

On Windows: "If path[1] is a':' (colon) or it starts with \\ or // (UNC paths), it is absolute; relative else"

No guarantees for completeness/correctness given though ;) The joys of file path handling ;)

Cheers, Oliver
-- 
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22



More information about the Qt-interest-old mailing list