Pascal / BaseUnix / FpOpendir
FpAccess, FpAlarm, FpChdir, FpChmod, FpChown, FpClose, FpClosedir, FpDup, FpDup2, FpExecv, FpExecve, FpExit, FpFcntl, pfdfillset, fpFD_CLR, fpFD_ISSET, fpFD_SET, fpFD_ZERO, FpFork, FPFStat, FpFtruncate, FpGetcwd, FpGetegid, FpGetEnv, fpgeterrno, FpGeteuid, FpGetgid, FpGetgroups, FpGetpgrp, FpGetpid, FpGetppid, fpGetPriority, FpGetuid, FpIOCtl, FpKill, FpLink, FpLseek, fpLstat, FpMkdir, FpMkfifo, Fpmmap, Fpmunmap, FpNanoSleep, fpNice, FpOpen, » FpOpendir, FpPause, FpPipe, FpRead, FpReaddir, fpReadLink, FpRename, FpRmdir, fpSelect, fpseterrno, FpSetgid, fpSetPriority, FpSetsid, fpsettimeofday, FpSetuid,
Funcion: FpOpendir()
Sintaxis:
function FpOpendir(
 
  dirname: pChar
 
):pDir;
 
function FpOpendir(
 
  dirname: AnsiString

Descripcion: Abre un directorio DirName, y retorna un registro apuntador a el directorio pdir, el cual puede ser utilizado para leer una estructura de directorios. Si el directorio no puede ser abierto, nil sera retornado

ERRORES:
Mas información acerca de los errores puede ser obtenida con la función fpGetErrno

Vea también
fpCloseDir
FpReadDir
Ejemplo:
Program Example35;
 
{ Program to demonstrate the
  OpenDir,ReadDir, SeekDir and TellDir functions. }
 
Uses BaseUnix;
 
Var TheDir : PDir;
    ADirent : PDirent;
    Entry : Longint;
 
begin
  TheDir:=fpOpenDir('./.');
  Repeat
//    Entry:=fpTellDir(TheDir);
    ADirent:=fpReadDir (TheDir^);
    If ADirent<>Nil then
      With ADirent^ do
        begin
        Writeln ('Entry No : ',Entry);
        Writeln ('Inode    : ',d_fileno);
//        Writeln ('Offset   : ',d_off);
        Writeln ('Reclen   : ',d_reclen);
        Writeln ('Name     : ',pchar(@d_name[0]));
        end;
  Until ADirent=Nil;
  Repeat
    Write ('Entry No. you would like to see again (-1 to stop): ');
    ReadLn (Entry);
    If Entry<>-1 then
      begin
//      fpSeekDir (TheDir,Entry);               // not implemented for various platforms
      ADirent:=fpReadDir (TheDir^);
      If ADirent<>Nil then
        With ADirent^ do
          begin
          Writeln ('Entry No : ',Entry);
          Writeln ('Inode    : ',d_fileno);
//          Writeln ('Offset   : ',off);
          Writeln ('Reclen   : ',d_reclen);
          Writeln ('Name     : ',pchar(@d_name[0]));
          end;
    end;
  Until Entry=-1;
  fpCloseDir (TheDir^);
end.

Librerias Pascal

Libreria crt - CRT - Pantalla y teclado del PASCAL de Turbo que maneja la unidad
Libreria dos - DOS - Interface Turbo Pascal MS-DOS
Libreria Graph - Unidad para manipular los graficos de la pantalla compatible con TP
Libreria Objects - Objetos basicos compatible con TP
Libreria math - Rutinas adicionales matematicas
Libreria Printer - Provee de acceso a la impresora
Libreria strings - Rutinas para el manejo de cadenas
Libreria BaseUnix - Funcionalidad Basica de Linux
Libreria System - Manejo de Archivos - Funciones para la manipulacion de archivos en Pascal