Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Misc > Re: Pascal File...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 4 Topic 790 of 811
Post > Topic >>

Re: Pascal File Commands and C Compatibility

by Marco van de Voort <marcov@[EMAIL PROTECTED] > May 6, 2008 at 08:58 AM

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.
 




 4 Posts in Topic:
Pascal File Commands and C Compatibility
Stang1 <scott_navarre@  2008-05-05 19:32:24 
Re: Pascal File Commands and C Compatibility
Marco van de Voort <ma  2008-05-06 08:58:20 
Re: Pascal File Commands and C Compatibility
Richard Engebretson <e  2008-05-06 03:36:56 
Re: Pascal File Commands and C Compatibility
Marco van de Voort <ma  2008-05-06 11:02:09 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 6:09:44 CDT 2008.