Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi attrib in Delphi? (https://www.delphipraxis.net/82690-attrib-delphi.html)

smart 18. Dez 2006 12:43


attrib in Delphi?
 
Hallo Alle!

Wie kann ich soetwas in Delphi umsetzen?

Delphi-Quellcode:
if not attrib -r Then attrib -r;

ste_ett 18. Dez 2006 12:58

Re: attrib in Delphi?
 
Dafür musst du mit MSDN-Library durchsuchenGetFileAttributes die Dateiattribute ermitteln und dann ggf. "FILE_ATTRIBUTE_READONLY" entfernen und mit MSDN-Library durchsuchenSetFileAttributes die neuen Attribute wieder setzen. :)

smart 18. Dez 2006 13:04

Re: attrib in Delphi?
 
Zitat:

Zitat von ste_ett
Dafür musst du mit MSDN-Library durchsuchenGetFileAttributes die Dateiattribute ermitteln und dann ggf. "FILE_ATTRIBUTE_READONLY" entfernen und mit MSDN-Library durchsuchenSetFileAttributes die neuen Attribute wieder setzen. :)

Hi.
Das hatte ich schon befürchtet. Gibt es da kein fertigen Delphi- Befehl für?

Gruß
Heike

Hawkeye219 18. Dez 2006 13:07

Re: attrib in Delphi?
 
Hier noch eine Möglichkeit:

Delphi-Quellcode:
FileSetReadOnly ('testfile.dat', False);
Gruß Hawkeye

Christian Seehase 18. Dez 2006 13:15

Re: attrib in Delphi?
 
Moin Heike,

Zitat:

Zitat von smart
Das hatte ich schon befürchtet. Gibt es da kein fertigen Delphi- Befehl für?

:shock:

Gibt's, wie Hawkeye schon geschrieben hat, aber was ist daran so schlimm zwei Zeilen zu schreiben?

smart 18. Dez 2006 13:50

Re: attrib in Delphi?
 
Zitat:

Zitat von Christian Seehase
was ist daran so schlimm zwei Zeilen zu schreiben?

Hi Christian!

Schlimm nicht, aber zwei Zeilen sind mehr als eine ;-)

Gruß
Heike


Alle Zeitangaben in WEZ +1. Es ist jetzt 09:17 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