Re: seek within a large file

From: Gerhard W. Gruber (sparhawk_at_gmx.at)
Date: 10/17/03


Date: Fri, 17 Oct 2003 21:57:59 +0200

On Fri, 17 Oct 2003 10:40:16 -0700 wrote Paul Lutus <nospam@nosite.zzz> in
comp.os.linux.misc with <vp0ac21j761l0f@corp.supernews.com>

>It is ultimately a C programming issue.

Not really. If he would call the read function from assembly it would be still
the same problem, but then it would be an assembly language question? Couldn't
be so. The problem is not with the name of the function, but what it doesn,
and that is the task of the operating system to provide. He is not asking what
the defined functionality is that is behind this function. If so then it would
be a C question, because then you can answer him, what the standard says what
this function should do. He is asking about an implementation detail, which is
most surely handled by the driver of the file system and which is no part of
the defined standard. As such it is a driver question, which makes it
operating system specific.

>> If he has to support multiple OS's and rely on that feature, then I would
>> suggest testing it, and check if this is really as he needs it. If not,
>> then he must find non-portable ways to achieve it an all targe platforms.
>
>Yes, unfortunately.

That's the way of cross platform programming. :) Even if the standard would
say the function may not read sequentially until it hits the offest, it could
easily be that he finds a system where it is still implemented this way. So
there is no way around testing on the target platform.

I once used printf in a way I normally didn't and it worked because I read the
man page about it. Unfortunately I didn't know that there are differences
between BSD and System V Unix versions. So you can not even rely with such a
basic standard function to support all features, you may need, on all
platforms.

>But it is what one should expect to get in a non-programming newsgroup.

:) That is true. :)

-- 
Gerhard Gruber
Für jedes menschliche Problem gibt es immer eine einfache Lösung:
Klar, einleuchtend und falsch. (Henry Louis Mencken)


Relevant Pages

  • Re: interesting use of NEXT SENTENCE vs. CONTINUE
    ... These days I don't do compiler maintenance, but I HAVE done in the past, so ... You had a chance to point out how adherence to the standard can improve ... >> compile it WITH MINOR MODIFICATIONS for a specific platform. ... > platform-specific extension to COBOL ...
    (comp.lang.cobol)
  • Re: interface
    ... Writing portable code has nothing to do with the operating system or ... independent of which operating system you are using. ... presented by the programming language and it's standard library. ... platform. ...
    (comp.programming)
  • Re: interesting use of NEXT SENTENCE vs. CONTINUE
    ... > implementations that purport to conform to a COBOL standard is to write ... I DID think any old compiler would be able to ... compile it WITH MINOR MODIFICATIONS for a specific platform. ... >> Portability depends on where you plan to port (or more likely where ...
    (comp.lang.cobol)
  • Re: interesting use of NEXT SENTENCE vs. CONTINUE
    ... I DID think any old compiler would be able to ... > compile it WITH MINOR MODIFICATIONS for a specific platform. ... > not going to go to the Standard to see what SHOULD work. ... If you write your COBOL code avoiding the things that are marked as ...
    (comp.lang.cobol)
  • Re: C portability is a myth
    ... > solicitation for the availability of a compiler for a given platform. ... If the source is pure Standard C ... can be successfully ported to all implementations. ...
    (comp.lang.c)