[fpc-pascal] fpc in symlinked directory

Tomas Hajny XHajT03 at hajny.biz
Thu Mar 27 08:53:39 CET 2014


On Wed, March 26, 2014 23:52, Mattias Gaertner wrote:
> On Wed, 26 Mar 2014 23:19:57 +0100
> "Tomas Hajny" <XHajT03 at hajny.biz> wrote:
>
>> On 26 Mar 14, at 23:05, Mattias Gaertner wrote:
>> > On Wed, 26 Mar 2014 18:47:06 +0100 (CET)
>> > Michael Van Canneyt <michael at freepascal.org> wrote:
>> >
>> > >[...]
>> > > The compiler does not do anything special: it determines its current
>> > > working directory using the RTL, meaning it gets the resolved
>> current
>> > > working directory.
>> >
>> > I described the situation from a user's pov.
>> > Somewhere it should be documented.
>> >
>> > BTW, is there already a RTL function to resolve a file name?
>> > Using SetCurrentDir is not thread safe.
>>
>> Is there any problem with ExpandFileName, or do you mean something
>> different by "resolving a file name"?
>
> There many ways to resolve a file name. ;)
> I just tried: ExpandFilename('/tmp/link') returns '/tmp/link'.
> It does not resolve symlinks.

Correct. However, the compiler doesn't use anything else as far as I know.
This kind of suggests that you shouldn't get a different behaviour between
the compiler and the IDE using this in my view? As an example, if you're
inside '/tmp/link' and call ExpandFileName('../somebuggyfile'), it should
give you the same result as show by the compiler in its error messages
when compiling this ../somebuggyfile.

Tomas





More information about the fpc-pascal mailing list