Sign in Join

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

Mailing lists / fpc-pascal / 2019-07

Warning: Symbol "faHidden" is not portable

9 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

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

James Richters

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

Reply by email

Unknown author
to James Richters
James Richters wrote 6 lines
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.*

Reply by email

James Richters
to Unknown author

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

Earlier message 21 lines
-----Original Message----- From: fpc-pascal On Behalf Of Sent: Friday, July 19, 2019 11:20 AM To: 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.* _______________________________________________

Reply by email

geneb
to James Richters
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_!

Reply by email

Giuliano Colla
to James Richters: I'm using Windows 10, but I may in the future want to make a Linux version of my program.…

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.

Reply by email

Unknown author
to geneb: Both MS-DOS and Windows have hidden file attribute bits. g. Proud owner of F-15C 80-0007…
geneb wrote 6 lines
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.*

Reply by email

James Richters
to Giuliano Colla: Il 19/07/2019 19:32, James Richters ha scritto: More exactly it means that fAHidden won't…

I appreciate the explanation it makes sense to me now. James

Earlier message 27 lines
-----Original Message----- From: fpc-pascal On Behalf Of Giuliano Colla Sent: Saturday, July 20, 2019 2:46 PM To: 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.

Reply by email

geneb
to Unknown author: right... i was specifically pointing out that *nix does not have those attributes and so…
Show quoted text 12 lines
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_!

Reply by email