Pascal / BaseUnix / FpRead
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: FpRead()
Sintaxis:
Descripcion: Lee la mayorÃÂÂÂa de nbytes del apuntador de archivos fd, y almacena después en buf.
La funcion retorna el numero de bytes actualmente leÃÂÂÂdos, o -1 si un error ha ocurrido. No revisando sobre el tamaño de buf fue terminado
ERRORES:
Mas información acerca de los errores puede ser obtenida con la funcion fpGetErrno
Vea También:
FpOpen
FpClose
FpWriteFpFTruncate
FpLSeek
Ejemplo:
Sintaxis:
function FpRead( fd: cInt; buf: pChar; nbytes: TSize ):TsSize; function FpRead(
Descripcion: Lee la mayorÃÂÂÂa de nbytes del apuntador de archivos fd, y almacena después en buf.
La funcion retorna el numero de bytes actualmente leÃÂÂÂdos, o -1 si un error ha ocurrido. No revisando sobre el tamaño de buf fue terminado
ERRORES:
Mas información acerca de los errores puede ser obtenida con la funcion fpGetErrno
Vea También:
FpOpen
FpClose
FpWriteFpFTruncate
FpLSeek
Ejemplo:
Program Example20; { Program to demonstrate the fdRead and fdTruncate functions. } Uses BaseUnix; Const Data : string[10] = '1234567890'; Var FD : cint; l : longint; begin FD:=fpOpen('test.dat',o_wronly or o_creat,&666); if fd>0 then begin { Fill file with data } for l:=1 to 10 do if fpWrite (FD,Data[1],10)<>10 then begin writeln ('Error when writing !'); halt(1); end; fpClose(FD); FD:=fpOpen('test.dat',o_rdonly); { Read data again } If FD>0 then begin For l:=1 to 5 do if fpRead (FD,Data[1],10)<>10 then begin Writeln ('Error when Reading !'); Halt(2); end; fpClose(FD); { Truncating file at 60 bytes } { For truncating, file must be open or write } FD:=fpOpen('test.dat',o_wronly,&666); if FD>0 then begin if fpfTruncate(FD,60)<>0 then Writeln('Error when truncating !'); fpClose (FD); end; end; end; end.
Librerias Pascal
Libreria crt - CRT - Pantalla y teclado del PASCAL de Turbo que maneja la unidadLibreria 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