
Добавил:
bagiwow
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Паскаль / do9 / iriepas201 / Irie Pascal / samples / dirpas
.pas //***************************************************
// This program lists all the files ending with .pas
// in the current diectory using the built-in
// procedure "exec".
// Basically the program determines whether it is running
// under a Unix-like platform or not and passes
// the approprate list command to "exec" along
// with the "*.pas" argument so that only files
// ending with .pas are listed.
program dirpas(output);
const
UnixListCommand = 'ls -l';
OtherListCommand = 'dir';
begin
if UnixPlatform then
exec(UnixListCommand, '*.pas')
else
exec(OtherListCommand, '*.pas');
if exitcode <> 0 then
writeln('Error listing directory', exitcode)
end.
// This program lists all the files ending with .pas
// in the current diectory using the built-in
// procedure "exec".
// Basically the program determines whether it is running
// under a Unix-like platform or not and passes
// the approprate list command to "exec" along
// with the "*.pas" argument so that only files
// ending with .pas are listed.
program dirpas(output);
const
UnixListCommand = 'ls -l';
OtherListCommand = 'dir';
begin
if UnixPlatform then
exec(UnixListCommand, '*.pas')
else
exec(OtherListCommand, '*.pas');
if exitcode <> 0 then
writeln('Error listing directory', exitcode)
end.
Соседние файлы в папке samples