System.SysUtils.FileSystemAttributes

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function FileSystemAttributes(const Path: string): TFileSystemAttributes;

C++

extern DELPHI_PACKAGE TFileSystemAttributes __fastcall FileSystemAttributes(const System::UnicodeString Path);

Properties

Type Visibility Source Unit Parent
function public
System.SysUtils.pas
System.SysUtils.hpp
System.SysUtils System.SysUtils

Description

Returns the attributes of a file system.

FileSystemAttributes returns the attributes of a file system specified by a path name. FileSystemAttributes extracts the drive identifier from the supplied path and returns the attributes of the file system on the drive. If the supplied path is invalid, an exception is thrown.

For example, if you want to know whether the drive X is removable, call this function with a valid path name from X. Code (Delphi):

  FileSysAttr := FileSystemAttributes('X:\');
  if fsRemovable in FileSysAttr then
    Writeln('Drive X is removable');

See Also