Thema: Delphi Dateistatus abfragen???

Einzelnen Beitrag anzeigen

Benutzerbild von nailor
nailor

Registriert seit: 12. Dez 2002
Ort: Karlsruhe
1.989 Beiträge
 
#5

Re: Dateistatus abfragen???

  Alt 15. Mai 2004, 20:11
HANDLE CreateFile(

LPCTSTR lpFileName, // pointer to name of the file
DWORD dwDesiredAccess, // access (read-write) mode
DWORD dwShareMode, // share mode
LPSECURITY_ATTRIBUTES lpSecurityAttributes, // pointer to security attributes
DWORD dwCreationDistribution, // how to create
DWORD dwFlagsAndAttributes, // file attributes
HANDLE hTemplateFile // handle to file with attributes to copy
);

dwShareMode
Set of bit flags that specifies how the object can be shared. If dwShareMode is 0, the object cannot be shared. Subsequent open operations on the object will fail, until the handle is closed.
To share the object, use a combination of one or more of the following values:

Value Meaning
FILE_SHARE_DELETE Windows NT only: Subsequent open operations on the object will succeed only if delete access is requested.
FILE_SHARE_READ Subsequent open operations on the object will succeed only if read access is requested.
FILE_SHARE_WRITE Subsequent open operations on the object will succeed only if write access is requested.


############################

setzt den share-mode auf "0", das sollte in der tat helfen

PS: "Habe was gelesen, das man mit FileCreate abfragen kann ob eine Datei exklusiv in Benutztung ist. Weiß da jemand was genaueres weil ich mit der Delphi-Hilfe nicht so ganz klarkomme bei diesem Befehl" nicht nachschauen, sondern bestimmen

PS2: der obige Code ist aus dem WindowsSDK, nicht der Delphi-Hilfe direkt, aber das SDK ist normal bei der Hilfe dabei, bei Delphi 7 sogar im Menü integriert

PS3: Hilft natürlich nur, wenns wirklich daran liegt
Michael N.
http://nailor.devzero.de/code/sharpmath/testing/ --- Tests, Feedback, Anregungen, ... aller Art sehr willkommen!
::: don't try so hard - it'll happen for a reason :::
  Mit Zitat antworten Zitat