System.IOUtils.TPath.GetAttributes
Delphi
class function GetAttributes(const Path: string; FollowLink: Boolean = True): TFileAttributes; inline; static;
C++
static TFileAttributes __fastcall GetAttributes(const System::UnicodeString Path, bool FollowLink = true);
プロパティ
種類 | 可視性 | ソース | ユニット | 親 |
---|---|---|---|---|
function | public | System.IOUtils.pas System.IOUtils.hpp |
System.IOUtils | TPath |
説明
ファイルまたはディレクトリ属性を返します。
指定のファイルまたはディレクトリの属性を取得するには、GetAttributes を呼び出します。 GetAttributes の戻り値は TFileAttribute 値の集合であり、集合内のそれぞれの値が 1 つのファイル属性を表します。
このメソッドに必要なパラメータの一覧を以下の表に示します:
Name | 意味 |
---|---|
Path |
属性を取得するファイルまたはディレクトリのパス。 |
FollowLink |
シンボリック リンクが使用されているかどうかを示します。 |
メモ: ファイルまたはディレクトリにアクセスできない場合やパスが無効な場合には、GetAttributes は例外を発生させます。
メモ:Path パラメータが シンボリック リンク であり、FollowLink パラメータが True に設定されている場合、このメソッドは対象ファイル(またはディレクトリ)に対して実行されます。 最初の条件が True だが FollowLink パラメータが False に設定されている場合、メソッドはシンボリック リンクに対して実行されます。 リンクが壊れている場合、メソッドは常に False を返します。