Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!jik From: jik@athena.mit.edu (Jonathan I. Kamens) Newsgroups: comp.unix.wizards Subject: Re: What, exactly, are stat.st_blocks, statfs.f_bsize? Message-ID: <1991Feb26.010146.27490@athena.mit.edu> Date: 26 Feb 91 01:01:46 GMT References: <1991Feb25.205932.16587@athena.mit.edu> <10283@dog.ee.lbl.gov> Sender: news@athena.mit.edu (News system) Organization: Massachusetts Institute of Technology Lines: 28 Well, if there are systems that measure st_blocks in terms of 1k blocks, how can I detect them in my source code? Assuming that it's always 512 bytes would leave me with the following code: int actual_bytes; struct stat statbuf; ... assume statbuf is initialized ... #ifdef ST_BLOCKS_EXISTS actual_bytes = statbuf.st_blocks * 512; #else actual_bytes = statbuf.st_size; #endif /* ST_BLOCKS_EXISTS */ But this is going to lose on sites that have 1k blocks. Is there any way to detect them. And, on a historical note, what led to the decision to measure in terms of 512-byte blocks, and why do some sites measure in terms of 1k blocks instead? -- Jonathan Kamens USnail: MIT Project Athena 11 Ashford Terrace jik@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8085 Home: 617-782-0710 Brought to you by Super Global Mega Corp .com