![]() |
Re: findnext+dateiattribute+schreibgeschuetzte verzeichnisse
Die Konstanten (so weit ich mich noch erinnere)
1 = Schreibgeschützt (Bit 0) 2 = Versteckt (Bit 1) 4 = System (Bit 2) 8 = Volume (Bit 3) 16 = Verzeichnis (Bit 4) 32 = Archiv (Bit 5) und seit neuestem 64 = Systemlink faAnyFile ist somit dann die Summe aus "1 + 2 + 4 + 8 + 16 + 32 = 63" Das ganze wird in einem Byte gespeichert deswegen auch mit or zu ermitteln Zum besseren Verständnis das ganze mal mit der Funktion "GetBit" wo einfach überprüft wird ob das 4te Bit gesetzt ist (bei 0 beginnend). Schneller als mit "GetBit" gehts natürlich mit "or" ist vielleicht nur nicht so verständlich das "or" für einige
Delphi-Quellcode:
function SetBit(const AByte: Cardinal; const ANewBitStatus: Boolean; const ABitIndex: TBitIndex): Cardinal;
begin if ANewBitStatus then result := AByte or (1 shl ABitIndex) else result := AByte and not(1 shl ABitIndex); end; function GetBit(const AByte: Cardinal; const ABitIndex: TBitIndex): Boolean; begin result := AByte = SetBit(AByte, True, ABitIndex); end; [...] //prüfen obs nen Verzeichnis ist if GetBit(sr.attr, 4) then |
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:45 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz