truncate file under SCO ODT 2.0

truncate file under SCO ODT 2.0

Post by Klaus Kre » Thu, 14 Jul 1994 22:03:30



I am porting a program that uses

        * int ftruncate (int fd, long length), which truncates a file
          (specified by fd) at the specified length,

to SCO ODT 2.0. Unfortunatly I don't find this function under SCO ODT 2.0.

Does anyone know how to deal with this problem?  If there is no such
simple thing as an aquivalent function, is there a work-around?

Please mail directly. I collect the responses and post them to the net.

                                Thanks
                                            Klaus

 
 
 

truncate file under SCO ODT 2.0

Post by Brian Fost » Fri, 15 Jul 1994 00:41:22


 | I am porting a program that uses:
 |
 |      int ftruncate (int fd, long length), which truncates a file
 |           (specified by fd) at the specified length,
 |
 | to SCO ODT 2.0.  Unfortunatly I don't find this function under SCO ODT 2.0.
 |
 | Does anyone know how to deal with this problem?  If there is no such
 | simple thing as an aquivalent function, is there a work-around?

try  . . . . . . . chsize(S).
or . . . . . . . . fcntl(S) F_FREESP -- may not be documented.
disclaimer . . . . my opinions are mine!
--
"Contents of air (London sample):  Air 0%,     | Brian Foster, INMOS, c/o PACT

 (*) Possibly a sampling error."               | +44 (0272) 707 156   England