Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!cbnews!cbnewsl!urban From: urban@cbnewsl.att.com (john.urban) Newsgroups: comp.unix.questions Subject: Re: Truncating an existing file (and lockf question) Message-ID: <1991Apr25.152121.3539@cbnewsl.att.com> Date: 25 Apr 91 15:21:21 GMT References: <3172@dsacg3.dsac.dla.mil> <16836@chaph.usc.edu> <1991Apr25.144430.350@wrkgrp.COM> Distribution: usa Organization: AT&T Bell Laboratories Lines: 29 In article <1991Apr25.144430.350@wrkgrp.COM> ets@wrkgrp.COM (Edward T Spire) writes: >In article <16836@chaph.usc.edu> jeenglis@alcor.usc.edu (Joe English) writes: >SCO/Unix. W/ SCO/Unix, chsize() takes the same parms as >ftruncate() and does the same thing... > >======================================================================== chsize is also available for UNIX System V/386 Release 3.2, and UNIX System V/386 Release 4.0. Little example ... $ cat C.c #include main() { int a; a = open("/tmp/passwd", O_WRONLY); chsize (a, 20L); close (a); } $ cp /etc/passwd /tmp/passwd $ cc -O C.c -o C -lx $ ./C $ ls -l /tmp/passwd -r--r--r-- 1 install other 20 Apr 25 11:17 /tmp/passwd Sincerely, John Urban