{"id":109,"date":"2007-05-12T14:23:59","date_gmt":"2007-05-12T12:23:59","guid":{"rendered":" http:\/\/www.nsonic.de\/blog\/2007\/05\/setting-file-attributes-german\/"},"modified":"2007-05-12T14:24:00","modified_gmt":"2007-05-12T12:24:00","slug":"setting-file-attributes-german","status":"publish","type":"post","link":"https:\/\/www.nsonic.de\/blog\/2007\/05\/setting-file-attributes-german\/","title":{"rendered":"Setting File Attributes (german)"},"content":{"rendered":"<p>Dateiattribute setzen (aus der D3 Onlinehilfe)<\/p>\n<p>Delphi erm\u00f6glicht es Ihnen, die Attribute jeder beliebigen Datei zu jedem beliebigen Zeitpunkt zu setzen.<br \/>\nUm die Attribute einer Datei zu setzen,<br \/>\n\u00dcbergeben Sie den Dateinamen und die gew\u00fcnschten Attribute an die Prozedur FileSetAttr..<br \/>\n<!--more--><br \/>\nBeispiel<\/p>\n<p>Der folgende Quelltext liest die Attribute einer Datei in eine Mengenvariable aus, setzt die Markierungsfelder des Dialogfelds Dateiattribute so, da\u00df sie die aktuellen Attribute anzeigen, und f\u00fchrt das Dialogfeld dann aus. \u00c4ndert und \u00fcbernimmt der Anwender Einstellungen des Dialogfelds, setzt der Quelltext die Dateiattribute so, da\u00df sie den ge\u00e4nderten Einstellungen entsprechen:<\/p>\n<p>[code lang=&#8221;delphi&#8221;]procedure TFMForm.Properties1Click(Sender: TObject);<br \/>\nvar<br \/>\n  Attributes, NewAttributes: Word;<br \/>\nbegin<br \/>\n  with FileAttrForm do<br \/>\n  begin<br \/>\n    FileDirName.Caption := FileList.Items[FileList.ItemIndex];\t{ Fenstertitel setzen }<br \/>\n    FilePathName.Caption := FileList.Directory;\t{ Verzeichnisnamen anzeigen }<br \/>\n    ChangeDate.Caption := DateTimeToStr(FileDateTime(FileList.FileName));<br \/>\n    Attributes := FileGetAttr(FileDirName.Caption);\t{ Dateiattribute auslesen }<br \/>\n    ReadOnly.Checked := (Attributes and faReadOnly) = faReadOnly;<\/p>\n<p>    Archive.Checked := (Attributes and faArchive) = faArchive;<br \/>\n    System.Checked := (Attributes and faSysFile) = faSysFile;<br \/>\n    Hidden.Checked := (Attributes and faHidden) = faHidden;<br \/>\n    if ShowModal <>  then\t{ Dialogfeld ausf\u00fchren }<br \/>\n    begin<br \/>\n      NewAttributes := Attributes;\t{ mit den urspr\u00fcnglichen Attributen beginnen }<br \/>\n      if ReadOnly.Checked then NewAttributes := NewAttributes or faReadOnly<br \/>\n      else NewAttributes := NewAttributes and not faReadOnly;<\/p>\n<p>      if Archive.Checked then NewAttributes := NewAttributes or faArchive<br \/>\n      else NewAttributes := NewAttributes and not faArchive;<br \/>\n      if System.Checked then NewAttributes := NewAttributes or faSysFile<br \/>\n      else NewAttributes := NewAttributes and not faSysFile;<br \/>\n      if Hidden.Checked then NewAttributes := NewAttributes or faHidden<br \/>\n      else NewAttributes := NewAttributes and not faHidden;<\/p>\n<p>      if NewAttributes <> Attributes then\t{ hat sich etwas ge\u00e4ndert&#8230; }<br \/>\n        FileSetAttr(FileDirName.Caption, NewAttributes);\t{ &#8230;die neuen Werte schreiben }<br \/>\n    end;<br \/>\n  end;<br \/>\nend;<br \/>\n[\/code]<\/p>\n<p>[tags]Delphi, File[\/tags]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Dateiattribute setzen (aus der D3 Onlinehilfe) Delphi erm\u00f6glicht es Ihnen, die Attribute jeder beliebigen Datei zu jedem beliebigen Zeitpunkt zu setzen. Um die&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[11],"tags":[75,99],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p71Tml-1L","_links":{"self":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts\/109"}],"collection":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/comments?post=109"}],"version-history":[{"count":0,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts\/109\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/media?parent=109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/categories?post=109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/tags?post=109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}