home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / next / misc / 18051 < prev    next >
Encoding:
Text File  |  1992-07-22  |  1.8 KB  |  50 lines

  1. Newsgroups: comp.sys.next.misc
  2. Path: sparky!uunet!darwin.sura.net!mips!zaphod.mps.ohio-state.edu!malgudi.oar.net!caen!batcomputer!cornell!uw-beaver!ubc-cs!unixg.ubc.ca!kakwa.ucs.ualberta.ca!news
  3. From: sherwood@fenris.space.ualberta.ca (Sherwood Botsford)
  4. Subject: Re: Swapfile Question
  5. Message-ID: <1992Jul22.164255.26504@kakwa.ucs.ualberta.ca>
  6. Sender: news@kakwa.ucs.ualberta.ca
  7. Nntp-Posting-Host: fenris.space.ualberta.ca
  8. Organization: University Of Alberta, Edmonton Canada
  9. References: <1992Jul21.110720.3224@investor.pgh.pa.us>
  10. Date: Wed, 22 Jul 1992 16:42:55 GMT
  11. Lines: 37
  12.  
  13. Bob Peirce #305 writes
  14. > In article <1992Jul16.195458.8181@kakwa.ucs.ualberta.ca>  
  15. sherwood@fenris.space.ualberta.ca (Sherwood Botsford) writes:
  16. > >    I agree that it would be nice if mach implemented some form of garbage  
  17. > >collection so that the swapfile would shrink dynamically.    But it's really  
  18. no  
  19. > >worse than what the other unices do.
  20. > Also, at the risk of finding out the NeXT can do this, no Unix I have
  21. > seen can shrink a file.  You can truncate them to zero, but as
  22. > desirable as it would be, you can't seem to free part of a file.  On the
  23. > surface this would seem to be a simple thing to do so maybe somebody
  24. > does it, but I haven't seen it.
  25.  
  26. Sorry Bob, Next can....
  27.  
  28. TRUNCATE(2)         UNIX Programmer's Manual          TRUNCATE(2)
  29.  
  30. NAME
  31.      truncate - truncate a file to a specified length
  32.  
  33. SYNOPSIS
  34.      truncate(path, length)
  35.      char *path;
  36.      off_t length;
  37.  
  38.      ftruncate(fd, length)
  39.      int fd;
  40.      off_t length;
  41.  
  42. DESCRIPTION
  43.      Truncate causes the file named by path or referenced by fd
  44.      to be truncated to at most length bytes in size.  If the
  45.      file previously was larger than this size, the extra data is
  46.      lost.  With ftruncate, the file must be open for writing.
  47.  
  48.