[fpc-pascal] fpc in symlinked directory

Michael Van Canneyt michael at freepascal.org
Wed Mar 26 15:33:38 CET 2014



On Wed, 26 Mar 2014, Mattias Gaertner wrote:

> On Wed, 26 Mar 2014 14:31:19 +0100 (CET)
>
>> [...]
>>> Just add a syntax error to unit1.pas and compile once in /tmp/link and
>>> once outside. You see once the physical directory and once the
>>> logical.
>>
>> So ? You just need to check the inode.
>
> Is there a function to list all files pointing to an inode?

Actually, you just need to know if 2 filenames point to the same inode.

You don't need all filenames pointing to the same inode.

>>>> and the OS do the same.
>>>
>>> The problem is the following:
>>> The user opens /tmp/link/project1.lpr in the source editor and runs
>>> it. When there is a syntax error or when the debugger stops they report
>>> a source file name '/tmp/orig/unit1.pas' and the user wonders why.
>>> The IDE automatically opens the file '/tmp/orig/unit1.pas', but since
>>> it shows in the tab only the 'unit1.pas' the user may confuse that
>>> with the right file.
>>
>> ? it IS the right file. It is the SAME file, after all.
>
> We could make a poll. I guess the majority expects that when the
> IDE compiles /tmp/link/project1.pas then it should
> work with /tmp/link/uni1.pas, not /somewhereelse/unit1.pas.

I certainly don't, but I guess we differ in our view. 
See my other mail.

>> [...]
>>> For instance:
>>> One include file used in different contexts. Depending on its file
>>> name different units use it and parse it differently. FPC reports the
>>> logical file name on an error and so the IDE knows the right context.
>>> The IDE opens the file two times and with different settings.
>>
>> Which IMHO is totally misplaced behaviour.
>
> Yes, and still: some people do that.

So ?

Let's say 90% of people use a screwdriver as a hammer. 
It doesn't make them right. It means 90% of people are abusing the screwdriver.

(just pulling something out of my hat, it may well be 95% or 75% or less)

Michael.



More information about the fpc-pascal mailing list