[fpc-pascal] FileGetAttr fails on TrueCrypt partition

reynolight reynolight at googlemail.com
Wed Apr 20 14:27:43 CEST 2011

Am 20.04.2011 13:47, schrieb Michael Van Canneyt:
> On Wed, 20 Apr 2011, reynolight wrote:
>> g: is the XP system volume. x: is the truecrypted NTFS partition. No
>> problem to set / get / show file attributes with Win32 GUI on both
>> volumes. Same with attrib.exe on console.
>> sysutils.FileGetAttr(g:\*) is fine, as well, but FileGetAttr(x:\*)
>> returns -1 as an error.
>> After copying a file from x: to g:, its attributes are - surprise - ok
>> again. Even bigger surprise: After re-copying from g: to x:,
>> FileGetAttr(x:\...) delivers the same correct result as on g:
> FileGetAttr is not supposed to accept wildcards.
> Michael.

Sorry. Just looks like wildcards here in my post. Of course,
FileGetAttr('*') doesn't work at all. To be exact with my issue, assume
a specific file x:\any.any, where x: is a mounted, truecrypted NTFS volume.

FileGetAttr('x:\any.any') returns  -1, i.e. error.

After copying x:\any.any to g:\any.any, FileGetAttr('g:\any.any')
returns 32, i.e. faArchive.

After copying g:\any.any back to x:\any.any, overwriting the previous
version, FileGetAttr('x:\any.any') now returns 32, i.e. faArchive as
well, as it should have been always, since we never modified the attributes.

Trying the same on XP GUI or with attrib.exe on console, I don't see any
similar issues.


More information about the fpc-pascal mailing list