Sign in Join
FPDoc Onlineexperiment

Dos unit

DOS - Turbo Pascal MS-DOS interface.

The DOS unit gives access to some operating system calls related to files, the file system, date and time. Except for the PalmOS target, this unit is available to all supported platforms.

The unit was first written for Dos by Florian Klaempfl. It was ported to Linux by Mark May and enhanced by Michael Van Canneyt. The Amiga version was ported by Nils Sjoholm.

Under non-DOS systems, some of the functionality is lost, as it is either impossible or meaningless to implement it. Other than that, the functionality is the same for all operating systems.

Because the DOS unit is a Turbo Pascal compatibility unit, it is no longer actively developed: the interface is frozen and it is maintained only for the purpose of porting Turbo Pascal programs. For new development, it is recommended to use the sysutils unit instead.

Classes and records

DateTimerecordRecord containing a date/time description.
RegistersrecordRecord to keep CPU registers for call. Unused.
SearchRecrecordFile Search Results record.

Procedures and functions

AddDiskfunctionAdd disk definition to list if drives (Unix only).
DiskFreefunctionGet free size on Disk.
DiskSizefunctionGet total size of disk.
DosExitCodefunctionExit code of last executed program.
DosVersionfunctionCurrent OS version.
DTToUnixDatefunctionConvert a DateTime to Unix timestamp.
EnvCountfunctionReturn the number of environment variables.
EnvStrfunctionReturn environment variable by index.
ExecprocedureExecute another program, and wait for it to finish.
FExpandfunctionExpand a relative path to an absolute path.
FindCloseprocedureDispose resources allocated by a / sequence.
FindFirstprocedureStart search for one or more files.
FindNextprocedureFind next matching file after .
FSearchfunctionSearch a file in searchpath.
FSplitprocedureSplit a full-path filename in parts.
GetCBreakprocedureGet control-Break flag.
GetDateprocedureGet the current date.
GetEnvfunctionGet environment variable by name.
GetFAttrprocedureGet file attributes.
GetFTimeprocedureGet file last modification time.
GetIntVecprocedureGet interrupt vector.
GetLongNamefunctionGet the long filename of a DOS 8.3 filename.
GetMsCountfunctionNumber of milliseconds since a starting point.
GetShortNamefunctionGet the short (8.3) filename of a long filename.
GetTimeprocedureReturn the current time.
GetVerifyprocedureGet verify flag.
IntrprocedureExecute interrupt.
KeepprocedureTerminate and stay resident.
MSDosprocedureExecute MS-DOS system call.
PackTimeprocedurePack DateTime value to a packed-time format.
SetCBreakprocedureSet Control-Break flag status.
SetDateprocedureSet system date.
SetFAttrprocedureSet file attributes.
SetFTimeprocedureSet file modification time.
SetIntVecprocedureSet interrupt vector.
SetTimeprocedureSet system time.
SetVerifyprocedureSet verify flag.
SwapVectorsprocedureSwap interrupt vectors.
UnixDateToDtprocedureConvert a Unix timestamp to a DateTime record.
UnpackTimeprocedureUnpack packed file time to a DateTime value.
weekdayfunctionReturn the day of the week.

Types

ComStrtypeCommand-line string type.
DirStrtypeFull directory string type.
ExtStrtypeFilename extension string type.
NameStrtypeFill filename string type.
PathStrtypeFull File path string type.

Constants

anyfileconstantMatch any file attribute.
archiveconstantArchive file attribute.
directoryconstantDirectory file attribute.
fauxiliaryconstantCPU auxiliary flag. Not used.
fcarryconstantCPU carry flag. Not used.
FileNameLenconstantMaximum length of a filename.
fmclosedconstantFile is closed.
fminoutconstantFile is read and write.
fminputconstantFile is read only.
fmoutputconstantFile is write only.
foverflowconstantCPU overflow flag. Not used.
fparityconstantCPU parity flag. Not used.
fsignconstantCPU sign flag. Not used.
fzeroconstantCPU zero flag. Not used.
hiddenconstantHidden file attribute.
readonlyconstantRead-Only file attribute.
sysfileconstantSystem file attribute.
volumeidconstantVolume ID file attribute.

Variables

DosErrorvariableLast OS (MS-DOS) error.

Topics

diskhandlingtopicDirectory and disk handling.
fileattributestopicFile attributes.
filehandlingtopicFile handling.
filemodestopicFile open mode constants.
processtopicProcess handling.
sysinfotopicSystem information.

Uses

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.