Autor Beitrag
kandesbunzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 116
Erhaltene Danke: 1


Delphi 7, XE2
BeitragVerfasst: Mo 27.11.06 14:20 
Hallo allerseits,

eigentlich trivial: Ich möchte das aktuelle Verzeichnisdatum (=Timestamp) ermitteln.

Die Funktionen zur Ermittlung setzen auf FileSearch und ff. Wenn aber das Verzeichnis gesperrt ist (bspw. Benutzerrechteverwaltung), liefert o.g. Funktion Null.

Gibt es einen anderen Weg?

Danke und auf bald ...
kandesbunzler.
Jakob Schöttl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 929
Erhaltene Danke: 1


Delphi 7 Professional
BeitragVerfasst: Mo 27.11.06 14:47 
Ich wusste gar nicht, dass Ordner auch Zeit-Stempel haben?
kandesbunzler Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 116
Erhaltene Danke: 1


Delphi 7, XE2
BeitragVerfasst: Mo 27.11.06 14:55 
Hallo Jakob,

danke für Deine Rü.

In meinem Fall geht es speziell um die Zeitnahme des Printerverzeichnisses (c:\windows\system32\spool\printers. Wenn ich als Normalbenutzer am System angemeldet bin, kann ich nicht in dieses Verzeichnis 'hineinschauen', aber das Datum mit bspw. dem Explorer oder Total Commander sehen. Wenn ein Druck von einer Applikation gestartet wird, d.h. Spoolfiles erstellt werden, ändert sich dieser Timestamp. Und genau das möchte ich ermitteln.

Auf bald ...
kandesbunzler.
Stefan.Buchholtz
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 612

WIN 2000, WIN XP, Mac OS X
D7 Enterprise, XCode, Eclipse, Ruby On Rails
BeitragVerfasst: Mo 27.11.06 15:04 
Schau dir mal die Windows-API Funktion GetFileAttributesEx an, mit der müsste es gehen.

Stefan

_________________
Ein Computer ohne Windows ist wie eine Schokoladentorte ohne Senf.
kandesbunzler Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 116
Erhaltene Danke: 1


Delphi 7, XE2
BeitragVerfasst: Mo 27.11.06 17:48 
Hallo allerseits,

wenn ich den Timestamp mittels der Funktion 'GetFileAttributesEx(pchar(FileName),GetFileExInfoStandard,@t);' aufrufe, sehe ich im Debugger für die erweiterten Parameter wie bspw. 'fwFileAttributes', 'ftCreationTime', etc. Wie kann ich für bswp. 'ftCreationTime die Werte für 'dwLowDateTime' ubd 'dwHighDateTime' 'extrahieren'?

Auf bald ...
kandesbunzler.
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Mo 27.11.06 22:53 
Hallo,

ein Ausschnitt aus meiner Procedur:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
var LTime : TFileTime;
    Systemtime : TSystemtime;
//...
    FileTimeToLocalFileTime( SR.FindData.ftCreationTime, LTime);
    FileTimeToSystemTime( LTime, SystemTime );
    SG.Cells[1,2] := FormatDateTime('dd/mm/yyyy   hh:nn:ss',SystemTimeToDateTime( SystemTime));

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
kandesbunzler Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 116
Erhaltene Danke: 1


Delphi 7, XE2
BeitragVerfasst: So 10.12.06 15:43 
Hallo allerseits,

vielen Dank - das Problem ist gelöst.
Ich schaue nur auf das Verzeichnisdatum selbst - nicht den Inhalt! -))

Auf bald ...