help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



[Overview][Constants][Types][Classes][Procedures and functions][Variables] Reference for unit 'System' (#rtl)

getdir

Return the current directory

Declaration

Source position: line 0

procedure getdir(

  drivenr: Byte;

  var dir: shortstring

);

procedure getdir(

  drivenr: Byte;

  var dir: ansistring

);

Description

Getdir returns in dir the current directory on the drive drivenr, where {drivenr} is 1 for the first floppy drive, 3 for the first hard disk etc. A value of 0 returns the directory on the current disk. On linux and unix systems, drivenr is ignored, as there is only one directory tree.

Errors

An error is returned under dos, if the drive requested isn't ready.

See also

Chdir

  

Change current working directory.

Example

Program Example29;

{ Program to demonstrate the GetDir function. }

Var S : String;

begin
  GetDir (0,S);
  Writeln ('Current directory is : ',S);
end.

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505