[fpc-pascal] fpc in symlinked directory
Michael Van Canneyt
michael at freepascal.org
Thu Mar 27 09:01:40 CET 2014
On Wed, 26 Mar 2014, Marc Weustink wrote:
> Michael Van Canneyt wrote:
>>
>>
>> On Wed, 26 Mar 2014, Mattias Gaertner wrote:
>>
>>> On Wed, 26 Mar 2014 15:33:38 +0100 (CET)
>>> Michael Van Canneyt <michael at freepascal.org> wrote:
>>>
>>>> [...]
>>>>>> 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.
>>>
>>> And what 2 files should I check? There are thousands of files in
>>> the search path.
>>
>> To avoid duplicates, only the files that are already open in the IDE
>> must be checked.
>> For the others, it is irrelevant how you opened them.
>>
>> There are 2 scenarios:
>>
>> 1. A file with a similar name (filename part matches) is already open in
>> the IDE.
>> If you collect the inode when opening, there is no problem (I'm
>> guessing you already do a stat on open.
>> 2. No such file is opened:
>> You can open it using whatever path.
>>
>> The next time a file must be opened, you check the file at the 'locical'
>> location, and if its inode matches an opened file, you know it is open
>> already.
>
> This will fail if the file is located on some smb or nfs mount.
I know. There are some other cases where it will fail.
After all the tests I did, it seems to me that the easiest solution is to
resolve the project filename (as FPC does), and work from there.
Michael.
More information about the fpc-pascal
mailing list