お知らせ

電子会議

ライブラリ

パレット

Delphi FAQ検索

Delphi FAQ一覧

サンプル蔵





FDelphi FAQ
16番会議室「玉石混淆みんなで作るSample蔵」に寄せられたサンプル

"ファイル/フォルダのタイムスタンプを取得"





 こんにちは、Tiny Mouse です。

 FileAge() や FileGetDate() では、フォルダのタイムスタンプは取得できませ
ん。フォルダのタイムスタンプも取得できる関数を用意しました。

{------------------------------------------------------------------------}

interface

uses
  Windows, SysUtils, Classes, FileCtrl;

function FileGetAge(Path: String): Integer;

implementation

{ ファイル/フォルダのタイムスタンプを取得する }

function FileGetAge(Path: String): Integer;
var
  sr: TSearchRec;
begin
  if FindFirst(Path, faAnyFile, sr) = 0 then
  begin
    Result := sr.Time;
    FindClose(sr);
  end
  else
  begin
    Result := -1;
  end;
end;

    ◆◆ KHC04052 : http://member.nifty.ne.jp/tinymouse/ : Tiny Mouse ◆◆

 


Original document by Tiny Mouse      氏 ID:(KHC04052)


ここにあるドキュメントは NIFTY SERVEの Delphi Users' Forum の16番会議室「玉石混淆みんなで作るSample蔵」に投稿されたサンプルです。これらのサンプルはボーランド株式会社がサポートする公式のものではありません。また、必ずしも動作が検証されているものではありません。これらのサンプルを使用したことに起因するいかなる損害も投稿者、およびフォーラムスタッフはその責めを負いません。使用者のリスクの範疇でご使用下さい。

Copyright 1996-2002 Delphi Users' Forum