Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2004.06.20;
Скачать: CL | DM;

Вниз

дата изменения файла   Найти похожие ветки 

 
zokzok   (2004-06-04 20:01) [0]

пробовал процедуру из FAQ, но она выдаёт совсем другую дату (не ту, что показывает windows)


 
GuAV ©   (2004-06-04 20:24) [1]


> пробовал процедуру из FAQ

облегчи ортвчающим жизнь - приведи эту процедуру - не все желают за тебя в FAQ рыться (я не желаю)


 
zokzok   (2004-06-04 20:53) [2]


function GetFileDate(FileName: string): string;
var  FHandle: Integer;
begin  FHandle := FileOpen(FileName, 0);
 try    
Result:=DateTimeToStr(FileDateToDateTime(FileGetDate(FHandle)));
 finally    FileClose(FHandle);
 end;
end;


 
DDA ©   (2004-06-04 21:01) [3]

http://delphibase.endimus.com/?action=viewtopic&topic=fileattr

Ищи примеры Димки маслова


 
Andy BitOff ©   (2004-06-04 21:05) [4]

Так я делаю, когда не хочу менять дату файла после внесений в него изменений:

var
 t1,t2,t3:TFileTime;
 h:hFile;
begin
 h:=_lopen(PChar(s),OF_READWRITE);
 GetFileTime(h,@t1,@t2,@t3);

 ...

 SetFileTime(h,@t1,@t2,@t3);
 CloseHandle(h);


Ети три даты (t1,t2,t3) и есть все даты файла, которые показывает винда.


 
zokzok   (2004-06-04 21:52) [5]

это всё круто, а как быть с датой изменения файла?


 
Anatoly Podgoretsky ©   (2004-06-04 22:12) [6]

Используй FindFirst это проще будет, выдаются все три даты


 
Andy BitOff ©   (2004-06-04 22:22) [7]

lpCreationTime
Points to a FILETIME structure to receive the date and time the file was created. This parameter can be NULL if the application does not require this information.

lpLastAccessTime
Points to a FILETIME structure to receive the date and time the file was last accessed. The last access time includes the last time the file was written to, read from, or, in the case of executable files, run. This parameter can be NULL if the application does not require this information.

lpLastWriteTime
Points to a FILETIME structure to receive the date and time the file was last written to. This parameter can be NULL if the application does not require this information.

первое это t1 - CreationTime
второе это t2 - LastAccessTime
третье это t3 - LastWriteTime


 
panov ©   (2004-06-04 22:35) [8]

ShowMessage(DateTimeToStr(FileDateToDateTime(FileAge("c:\autoexec.bat"))));



Страницы: 1 вся ветка

Текущий архив: 2004.06.20;
Скачать: CL | DM;

Наверх




Память: 0.48 MB
Время: 0.042 c
14-1086374847
SergP
2004-06-04 22:47
2004.06.20
Есть ли готовая игруха типа преферанса, но сетевая?


1-1086677667
KSergey
2004-06-08 10:54
2004.06.20
О несовпадении параметров предварит..го обределения и реализации


1-1086448251
Kostya
2004-06-05 19:10
2004.06.20
Progress Bar


9-1077688627
Kid
2004-02-25 08:57
2004.06.20
TriangleList & TriangleStrip


14-1085997157
AlexG
2004-05-31 13:52
2004.06.20
Как вы относитесь к брэккет системам?