Warning: Symbol "faHidden" is not portable

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Warning: Symbol "faHidden" is not portable

Zaaphod
What does  'Warning: Symbol "faHidden" is not portable' mean exactly?  I’m using it with FindFirst and FindNext,  I'm just wondering if there is a better way of getting directory information that includes hidden and excludes hidden files in a better way that would not generate this warning.  The Fact that there is a warning about it indicates to me that there must be a better way.

James
_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Warning: Symbol "faHidden" is not portable

wkitty42
On 7/19/19 7:45 AM, James Richters wrote:
> What does  'Warning: Symbol "faHidden" is not portable' mean exactly?  I’m
> using it with FindFirst and FindNext,  I'm just wondering if there is a
> better way of getting directory information that includes hidden and excludes
> hidden files in a better way that would not generate this warning.  The Fact
> that there is a warning about it indicates to me that there must be a better
> way.
what OS? some OSes do not have hidden attribute like DOS and winwhatever... for
example, on most *nix, they use dot files which are generally specifically not
listed unless special steps are taken to show them... a "dot file" is one that
the filename starts with a dot...

   eg: .dirindex

--
  NOTE: No off-list assistance is given without prior approval.
        *Please keep mailing list traffic on the list unless*
        *a signed and pre-paid contract is in effect with us.*
_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Warning: Symbol "faHidden" is not portable

Zaaphod
I'm using Windows 10, but I may in the future want to make a Linux version of my program.  I guess that's what the warning is about.. that fAHidden won't detect hidden files on some operating systems?

James

-----Original Message-----
From: fpc-pascal <[hidden email]> On Behalf Of [hidden email]
Sent: Friday, July 19, 2019 11:20 AM
To: [hidden email]
Subject: Re: [fpc-pascal] Warning: Symbol "faHidden" is not portable

On 7/19/19 7:45 AM, James Richters wrote:
> What does  'Warning: Symbol "faHidden" is not portable' mean exactly?  
> I’m using it with FindFirst and FindNext,  I'm just wondering if there
> is a better way of getting directory information that includes hidden
> and excludes hidden files in a better way that would not generate this
> warning.  The Fact that there is a warning about it indicates to me
> that there must be a better way.
what OS? some OSes do not have hidden attribute like DOS and winwhatever... for example, on most *nix, they use dot files which are generally specifically not listed unless special steps are taken to show them... a "dot file" is one that the filename starts with a dot...

   eg: .dirindex

--
  NOTE: No off-list assistance is given without prior approval.
        *Please keep mailing list traffic on the list unless*
        *a signed and pre-paid contract is in effect with us.* _______________________________________________
fpc-pascal maillist  -  [hidden email] https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Warning: Symbol "faHidden" is not portable

geneb
On Fri, 19 Jul 2019, James Richters wrote:

> what OS? some OSes do not have hidden attribute like DOS and
> winwhatever... for example, on most *nix, they use dot files which are

Both MS-DOS and Windows have hidden file attribute bits.

g.

--
Proud owner of F-15C 80-0007
http://www.f15sim.com - The only one of its kind.
http://www.diy-cockpits.org/coll - Go Collimated or Go Home.
Some people collect things for a hobby.  Geeks collect hobbies.

ScarletDME - The red hot Data Management Environment
A Multi-Value database for the masses, not the classes.
http://scarlet.deltasoft.com - Get it _today_!
_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Warning: Symbol "faHidden" is not portable

Free Pascal - General mailing list
In reply to this post by Zaaphod
James Richters <[hidden email]> schrieb am Fr., 19. Juli 2019, 19:32:
I'm using Windows 10, but I may in the future want to make a Linux version of my program.  I guess that's what the warning is about.. that fAHidden won't detect hidden files on some operating systems?

Correct. 

Regards, 
Sven 

_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Warning: Symbol "faHidden" is not portable

Giuliano Colla
In reply to this post by Zaaphod
Il 19/07/2019 19:32, James Richters ha scritto:

> I'm using Windows 10, but I may in the future want to make a Linux version of my program.  I guess that's what the warning is about.. that fAHidden won't detect hidden files on some operating systems?

More exactly it means that fAHidden won't detect a hidden file in any
OS, except Windows (and DOS if you care about).

It means File Attribute = Hidden, and only Microsoft has the Hidden flag
among the file attributes.
A file in Linux is hidden if the first character of its name is a dot.
If you want to make a file hidden, or make visible a hidden file, you
must rename it. But this visibility rule applies only to POSIX human
interface applications. If you programmatically read a directory, you
always get all files.

If your goal is to get all files of a directory, hidden or not, then you
need fAHidden only for Windows, because the fpc procedures will get all
of them under Linux.

If your goal is to tell apart hidden files from visible ones then you
must use platform specific ifdef's, using fAHidden for Windows, and
checking for the first character of the name under Linux (or UNIX,
because all Unices follow the same rule).

Hope that it helps,

Giuliano

--
Do not do to others as you would have them do to you.They might have different tastes.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Warning: Symbol "faHidden" is not portable

wkitty42
In reply to this post by geneb
On 7/19/19 1:58 PM, geneb wrote:
> On Fri, 19 Jul 2019, James Richters wrote:
>
>> what OS? some OSes do not have hidden attribute like DOS and winwhatever...
>> for example, on most *nix, they use dot files which are
>
> Both MS-DOS and Windows have hidden file attribute bits.


right... i was specifically pointing out that *nix does not have those
attributes and so faHidden is apparently not portable to them... my wording
could have possibly been a bit clearer... sorry...


--
  NOTE: No off-list assistance is given without prior approval.
        *Please keep mailing list traffic on the list unless*
        *a signed and pre-paid contract is in effect with us.*
_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Warning: Symbol "faHidden" is not portable

Zaaphod
In reply to this post by Giuliano Colla
I appreciate the explanation it makes sense to me now.
James
-----Original Message-----
From: fpc-pascal <[hidden email]> On Behalf Of Giuliano Colla
Sent: Saturday, July 20, 2019 2:46 PM
To: [hidden email]
Subject: Re: [fpc-pascal] Warning: Symbol "faHidden" is not portable

Il 19/07/2019 19:32, James Richters ha scritto:

> I'm using Windows 10, but I may in the future want to make a Linux version of my program.  I guess that's what the warning is about.. that fAHidden won't detect hidden files on some operating systems?

More exactly it means that fAHidden won't detect a hidden file in any OS, except Windows (and DOS if you care about).

It means File Attribute = Hidden, and only Microsoft has the Hidden flag among the file attributes.
A file in Linux is hidden if the first character of its name is a dot.
If you want to make a file hidden, or make visible a hidden file, you must rename it. But this visibility rule applies only to POSIX human interface applications. If you programmatically read a directory, you always get all files.

If your goal is to get all files of a directory, hidden or not, then you need fAHidden only for Windows, because the fpc procedures will get all of them under Linux.

If your goal is to tell apart hidden files from visible ones then you must use platform specific ifdef's, using fAHidden for Windows, and checking for the first character of the name under Linux (or UNIX, because all Unices follow the same rule).

Hope that it helps,

Giuliano

--
Do not do to others as you would have them do to you.They might have different tastes.

_______________________________________________
fpc-pascal maillist  -  [hidden email] https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Warning: Symbol "faHidden" is not portable

geneb
In reply to this post by wkitty42
On Sat, 20 Jul 2019, [hidden email] wrote:

> On 7/19/19 1:58 PM, geneb wrote:
>> On Fri, 19 Jul 2019, James Richters wrote:
>>
>>> what OS? some OSes do not have hidden attribute like DOS and
> winwhatever...
>>> for example, on most *nix, they use dot files which are
>>
>> Both MS-DOS and Windows have hidden file attribute bits.
>
> right... i was specifically pointing out that *nix does not have those
> attributes and so faHidden is apparently not portable to them... my wording
> could have possibly been a bit clearer... sorry...

My apologies - I completely mis-read your statement.  My fault. :)

g.

--
Proud owner of F-15C 80-0007
http://www.f15sim.com - The only one of its kind.
http://www.diy-cockpits.org/coll - Go Collimated or Go Home.
Some people collect things for a hobby.  Geeks collect hobbies.

ScarletDME - The red hot Data Management Environment
A Multi-Value database for the masses, not the classes.
http://scarlet.deltasoft.com - Get it _today_!
_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal