🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #654

Re: URGENTE..PASCAL

#654
From: Pascal Bourguignon
Date: Sat, 20 Jan 2007 16:35
67 lines
3658 bytes
"lqf" <abcdefghijoseantonio@hotmail.com> writes:

> Mi pregunta es como se abre un fichero para escritura y lectura(me
> podriais decir en codigo que necesitaria).

�No lo s�!  Hace demasiado tiempo que no uso m�s pascal.

Veamos, somos en es.comp.os.LINUX.programaci�n, entonces voy a suponer
que usas free pascal, que jamas has mencionado que compilador usas.

Luego vamos a: http://www.google.com/ 
y tecleamos: free pascal open file read write

Vemos en tercer lugar, "Free Pascal: Reference guide."
Hagamos clic en el.
Buscamos file en la p�gina.
el primiero es File types, saltamosle.
el segundo es File handling, hagamos clic en el.
Leemos que hay una funcion Append para abrir en escritura (a�aniendo),
Reset y Rewrite para abrir en lectura o escritura.

Asi que parece que en la unit system de free pascal, hay solamente las
funciones standard, permitiendo abrir un archivo en una sola
dirrecci�n.


Veamos la documentaci�n del sitio http://www.freepascal.org/
Hagamos clic en Documentation.

Hagamos clic en Standard units reference manual (en el aparte HTML).

No hay unit para los archivos, pero vemos una unit Linux.  Hagamos
clic en ella.

Vemos que Linux esta repartida ahora en unix, baseunix y
unixutil. Buscamos en unix primiero (haga clic en unix).

Hagamos clic en Procedures and functions.  No vemos open, asi que debe
estar en un otra unit.  Hagamos clic en el buton para volver a la
p�gina precedente dos veces, y hagamos clic en baseunix.

Hagamos clic en Procedures and functions.  

Ahora vemos una funci�n  FpOpen.  Hagamos clic en FpOpen.

Vemos que se puede usar:

use unixbase;
var fd:cInt;
begin
  fd=FpOpen("/tmp/some-file",O_RdWr,438(*(decimal) = 666(octal) *));
end;

para abri un archivo unix en modo lectura-escritura.

Luego habra que buscar funciones para posicionarse en el archivo, y
leer y escribir bloques.  Si haces clic en Procedures and functions,
encuentraras otras funciones interesantes como FpLseek y FpRead y
FpWrite, etc.


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

CONSUMER NOTICE: Because of the "uncertainty principle," it is
impossible for the consumer to simultaneously know both the precise
location and velocity of this product.
Technical Details
Message-ID: <87lkjxslk8.fsf@thalassa.informatimago.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
References: <1168687449.316024.60110@a75g2000cwd.googlegroups.com> <877ivr3rvj.fsf@thalassa.informatimago.com> <1169289502.650269.268960@q2g2000cwa.googlegroups.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: f86c8,a15f00c2969f0180
X-Google-Attributes: gidf86c8,public
X-Google-Language: SPANISH,ASCII
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: Pascal Bourguignon <pjb@informatimago.com>
Newsgroups: es.comp.os.linux.programacion
Subject: Re: URGENTE..PASCAL
Date: Sat, 20 Jan 2007 17:35:35 +0100
Organization: Informatimago
Lines: 67
Message-ID: <87lkjxslk8.fsf@thalassa.informatimago.com>
References: <1168687449.316024.60110@a75g2000cwd.googlegroups.com> <877ivr3rvj.fsf@thalassa.informatimago.com> <1169289502.650269.268960@q2g2000cwa.googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: individual.net DkYFvfKJEdb34I3k6xpFiQGkA27D0Nwecbe6FCLF+xnJgvi/bY
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA
      oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9
      033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac
      l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR
      mV+hO/VvFAAAAABJRU5ErkJggg==
X-Accept-Language:         fr, es, en
X-Disabled: X-No-Archive: no
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux)
Cancel-Lock: sha1:g3lXzhHWR8xiFbmfv5FaZ1qTShU=