[fpc-pascal] TFileStream.Create and hidden files on Windows

Michael Van Canneyt michael at freepascal.org
Thu Jan 15 17:38:28 CET 2015



On Thu, 15 Jan 2015, Bart wrote:

> Hi,
>
> I have some old tools lying around that are still in use, and I
> modernized them a bit.
> One part of that is to replace file handling with FileStreams whenever
> apllicable.
>
> This all went without major hickups, until one of my tools suddenly crashed.
>
> Where in the past it did a Rewrite(Filevar,1), it now uses
> TFileStream.Create with appropriate parameters.
> The file in question turned out to have the hidden attribute set.
> While this poses no problem to rewrite/reset, TFileStream.Create does
> not like it and fails.

It seems strange that rewrite/reset handles it, because a quick search reveals 
that there is no handling of FILE_ATTRIBUTE_HIDDEN in the RTL.

Michael.



More information about the fpc-pascal mailing list