b> > There are certainly no sparse files creatable with fseek and friends
> > on IRIX 4.

...

> Irix is based on SVR4 -- it was not written from scratch by SGI.

Minor nit -- he said Irix 4, which is SVR3 if I'm not mistaken.

> Every SVR4 box, indeed, every unix box I have used has had holes in files.
> I will admit to not having explicitly checked this particular feature on
> an SGI, but unless SGI has been removing documented SVID functionality
> for some reason, you are wrong.
> 
> I will, of course, happily conceed to a reposting of a section of man
> page that explicitly states that the functionality has been removed.

Every Unix system on which I've thought to check has had sparse files
too.  Not wanting to RTFM I tried the following program:

    $ cat holes.c

    #include <stdio.h>

    main()
    {
        fseek(stdout, 1024*1024, SEEK_SET);
        putchar('$');
    }

On a BSDI system, here's what happened:

    $ uname -a
    BSD/386 ohare.Chicago.COM 1.1 0 i386
    $ rm -f foo bar
    $ ./holes > foo
    $ cat foo > bar
    $ ls -ls foo bar
    1040 -rw-r--r--  1 kls  users  1048577 May  1 17:18 bar
      16 -rw-r--r--  1 kls  users  1048577 May  1 17:18 foo

As seen in the -s field (the first one), foo really is sparse.  I then
tried an Irix 4 system:

    $ uname -a
    IRIX Z0 4.0.1 11150233 IP4
    $ rm -f foo bar
    $ ./holes > foo
    $ cat foo > bar
    $ ls -ls foo bar
    2049 -rw-r--r--   1 kls      ugserve  1048577 May  2 18:27 bar
    2049 -rw-r--r--   1 kls      ugserve  1048577 May  2 18:27 foo

Much to my susprise, there do not appear to be any holes in foo.  I
verified this with df, which indeed showed a change in space usage
consistent with a non-sparse file.

I'd try it on Irix 5.2, but we only have one system running that and
it appears to be down at the moment.  I did try it on AIX 3.2.5, which
is more likely to be different from Unix than any other "Unix," and it
too appeared to have sparse files.

--
Karl Swartz             |INet   [EMAIL PROTECTED]
SLAC Computing Services |          or [EMAIL PROTECTED]
1-415/926-3630          |UUCP   uunet!lll-winken!unixhub!kls  -or-  ditka!kls
(SLAC and the US Dept. of Energy don't necessarily agree with my opinions.)

Reply via email to