Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2020-09

-Fu unit search path and network paths

10 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

LacaK

Hi *,

are supported in -Fu (unit search path) networks paths? i.e. -Fu\\server\share -Fu\\server\share\path ?
When I am compiling project, which is located on local drive, but uses units from network, error is raised while compiling project file .lpr "Cannot find XYZ used by ..."
(when I map network path to drive letter then it works as expected)

TIA

-Laco.

Reply by email

LacaK
to LacaK
Hi *, are supported in -Fu (unit search path) networks paths? i.e. -Fu\\server\share -Fu\\server\share\path ?

Correction: unit cannot be found only if it is placed in "share root" \\server\share !
When is placed in \\server\share\path then it is found.

Why?

Show quoted text 12 lines
When I am compiling project, which is located on local drive, but uses units from network, error is raised while compiling project file .lpr "Cannot find XYZ used by ..." (when I map network path to drive letter then it works as expected) TIA -Laco. _______________________________________________ fpc-pascal maillist  -  https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email

LacaK
to LacaK
Show quoted text 9 lines
> Hi *, > > are supported in -Fu (unit search path) networks paths? i.e. > -Fu\\server\share -Fu\\server\share\path ? Correction: unit cannot be found only if it is placed in "share root" \\server\share ! When is placed in \\server\share\path then it is found.

Addition:

when I use in *uses* clause:

use unit1 in '\\server\share\unit1.pas'

then *it works* also when I omit search path from -Fu (no search paths specified in Project Options)

strange, does not?

Show quoted text 18 lines
Why? > When I am compiling project, which is located on local drive, but > uses units from network, error is raised while compiling project file > .lpr "Cannot find XYZ used by ..." > (when I map network path to drive letter then it works as expected) > > TIA > > -Laco. > > _______________________________________________ > fpc-pascal maillist  -  > https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal _______________________________________________ fpc-pascal maillist  -  https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email

Marco van de Voort
to LacaK: Correction: unit cannot be found only if it is placed in "share root" \\server\share !…

Op 2020-09-21 om 08:57 schreef LacaK via fpc-pascal:

Show quoted text 10 lines
> Hi *, > > are supported in -Fu (unit search path) networks paths? i.e. > -Fu\\server\share -Fu\\server\share\path ? Correction: unit cannot be found only if it is placed in "share root" \\server\share ! When is placed in \\server\share\path then it is found. Why?

Possibly Share vs directory.   A directory has 4 slashes (\\x\y\<something), a share two.

Try \\server\share\.

Note that probably none of this is supported, just coincidence because Windows functions interpret it themselves.

Reply by email

LacaK
to Marco van de Voort

Dňa 21.9.2020 o 12:35 Marco van de Voort via fpc-pascal napísal(a):

Show quoted text 17 lines
Op 2020-09-21 om 08:57 schreef LacaK via fpc-pascal: > >> Hi *, >> >> are supported in -Fu (unit search path) networks paths? i.e. >> -Fu\\server\share -Fu\\server\share\path ? > Correction: unit cannot be found only if it is placed in "share root" > \\server\share ! > When is placed in \\server\share\path then it is found. > > Why? Possibly Share vs directory.   A directory has 4 slashes (\\x\y\<something), a share two. Try \\server\share\.

*Does not works. More confusing is that, when I map \\server\share to F:\ and I add F:\ to search path it does not work also! *

*(if unit is in any subdirectory i.e. F:\something then it works ... so only root does not work!)*

*
*

Note that probably none of this is supported, just coincidence because Windows functions interpret it themselves.

*But how to explain cause with F:\ ?*

*
*

*L.*
**

Reply by email

Marco van de Voort
to LacaK

Op 2020-09-21 om 13:44 schreef LacaK via fpc-pascal:

Show quoted text 23 lines
>>> are supported in -Fu (unit search path) networks paths? i.e. >>> -Fu\\server\share -Fu\\server\share\path ? >> Correction: unit cannot be found only if it is placed in "share >> root" \\server\share ! >> When is placed in \\server\share\path then it is found. >> >> Why? > > Possibly Share vs directory.   A directory has 4 slashes > (\\x\y\<something), a share two. > > Try \\server\share\. *Does not works. More confusing is that, when I map \\server\share to F:\ and I add F:\ to search path it does not work also! * *(if unit is in any subdirectory i.e. F:\something then it works ... so only root does not work!)* * *

[0.015] Handling option "-Fud:\"
[0.015] interpreting option "-Fud:\"
[0.015] Path "D:\" not found

So the path exist function probably fails on root dirs.

Reply by email

Michael Van Canneyt
to Ryan Joseph
Ryan Joseph wrote 7 lines
> On Sep 21, 2020, at 2:16 PM, LacaK via fpc-pascal wrote: > > when I use in *uses* clause: I never knew "in" even existed! This totally blows my mind. Was it something added from Delphi that I never heard about?

Since the very first versions of Delphi.

Michael.

Reply by email

Tomas Hajny
to Marco van de Voort: Op 2020-09-21 om 13:44 schreef LacaK via fpc-pascal: [0.015] Handling option "-Fud:\"…
Marco van de Voort wrote 29 lines
Op 2020-09-21 om 13:44 schreef LacaK via fpc-pascal: > >>>> are supported in -Fu (unit search path) networks paths? i.e. >>>> -Fu\\server\share -Fu\\server\share\path ? >>> Correction: unit cannot be found only if it is placed in "share >>> root" \\server\share ! >>> When is placed in \\server\share\path then it is found. >>> >>> Why? >> >> Possibly Share vs directory.   A directory has 4 slashes >> (\\x\y\<something), a share two. >> >> Try \\server\share\. > *Does not works. More confusing is that, when I map \\server\share to > F:\ and I add F:\ to search path it does not work also! > * > > *(if unit is in any subdirectory i.e. F:\something then it works ... > so only root does not work!)* > > * > * > [0.015] Handling option "-Fud:\" [0.015] interpreting option "-Fud:\" [0.015] Path "D:\" not found So the path exist function probably fails on root dirs.

This looks like the infamous wrong implementation of checking of directory existence based on reading its attributes (which doesn't work for the root directory, because it has no specific entry on the file-system and thus also no attributes, at least on DOS-like systems) without special handling of the special case of the root directory:

cfileutl.pas, line 361-375 (trunk):

     function TCachedDirectory.DirectoryExists(const
AName:TCmdStr):boolean;
       var
         Attr : Longint;
       begin
         if not TryUseCache then
           begin
             Result:=PathExists(Name+AName,false);
             exit;
           end;
         Attr:=GetItemAttr(AName);
         if Attr0 then
           Result:=((Attr and faDirectory)=faDirectory)
         else
           Result:=false;
       end;

I suggest filing a bug report.

Tomas

Reply by email

LacaK
to Tomas Hajny
Show quoted text 56 lines
>> >>>>> are supported in -Fu (unit search path) networks paths? i.e. >>>>> -Fu\\server\share -Fu\\server\share\path ? >>>> Correction: unit cannot be found only if it is placed in "share >>>> root" \\server\share ! >>>> When is placed in \\server\share\path then it is found. >>>> >>>> Why? >>> >>> Possibly Share vs directory.   A directory has 4 slashes >>> (\\x\y\<something), a share two. >>> >>> Try \\server\share\. >> *Does not works. More confusing is that, when I map \\server\share >> to F:\ and I add F:\ to search path it does not work also! >> * >> >> *(if unit is in any subdirectory i.e. F:\something then it works ... >> so only root does not work!)* >> >> * >> * >> > [0.015] Handling option "-Fud:\" > [0.015] interpreting option "-Fud:\" > [0.015] Path "D:\" not found > > So the path exist function probably fails on root dirs. This looks like the infamous wrong implementation of checking of directory existence based on reading its attributes (which doesn't work for the root directory, because it has no specific entry on the file-system and thus also no attributes, at least on DOS-like systems) without special handling of the special case of the root directory: cfileutl.pas, line 361-375 (trunk):     function TCachedDirectory.DirectoryExists(const AName:TCmdStr):boolean;       var         Attr : Longint;       begin         if not TryUseCache then           begin             Result:=PathExists(Name+AName,false);             exit;           end;         Attr:=GetItemAttr(AName);         if Attr0 then           Result:=((Attr and faDirectory)=faDirectory)         else           Result:=false;       end; I suggest filing a bug report.

Reported https://bugs.freepascal.org/view.php?id=37793

If you can add there more details please do it ;-)

-Laco.

Reply by email