On 2008-05-06, Stang1 <scott_navarre@[EMAIL PROTECTED]
> wrote:
> I am converting a C program to Pascal and have a few questions:
>
> First of all, if I open a file as a text file (using Assign and
> Reset) and then use the pascal command GetFS -- can I then use Pascal
> commands such as fdRead and fdSeek without having to first open it
> with fdOpen?
Yes, if you know the handle is open. But it is dangerous, because you
bypass a buffered system. So it is comparable to accessing a FILE * using
syscalls under C.
What version are you using? The above commands are afaik the 1.0.x naming
which is deprecated (in which unit did you find them gives a clue?)
> Second, are there Pascal commands compatible with the standard C
> functions ftell() and rewind()?
No. The other commands are real primitives, and these aren't. (they are
lseek derivates). Of course ftell exists on Pascal level (filepos), but
not
as call.
Note that fp*/fd* don't necessarily map to their C equivalents. On FreeBSD
and Linux they are own implementations over the kernel versions, not the
libc ones.


|