Re: Create empty files?
- From: Mensanator <mensanator@xxxxxxx>
- Date: Tue, 5 Jan 2010 17:37:07 -0800 (PST)
On Jan 5, 2:35 pm, Victor Porton <porton.vic...@xxxxxxxxx> wrote:
On Jan 5, 10:19 pm, Mensanator <mensana...@xxxxxxx> wrote:
On Jan 5, 12:20 pm, Victor Porton <por...@xxxxxxxx> wrote:
An application uses files with IDs.
What of the following two variants is preferred?
1. To create empty IDs files at setup script.
2. If an IDs file is missing, treat it as if it would exist but empty..
Because empty files are not "empty" as far as the directory is
You should first answer first of my questions and only then the
From what you say about my second question, I assume that your answer
to the first question is:
2. If an IDs file is missing, treat it as if it would exist but empty.
The directory entry may not point to anything, but it takes up space.
A directory block can typically only hold 512 entries. When the
gets larger than that, a new block must be allocated. Very likely this
will result in a fragmented directory, making it much more difficult
to scan through. This may not be applicable to all OSes, I remember it
from observing some clown who put thousands of files into a single
and then wondered why it was slower than snake shit.
A few bytes of free space isn't a concern for the particular
application which I write.
Also adding to the source code processing of non-existing files would
probably eat comparable quantity of bytes as would creation of these
I'm more interested in programming beautify and clarity than in a few
bytes of free space.
Does anybody else have an opinion on my question?
Oo, bite my head off for trying to be a nice guy!
Ok, here's the REAL answer:
- Prev by Date: Re: quick sort and O(nlgn) worst case bound
- Next by Date: [ANN] Winter 2009 issue of Methods & Tools
- Previous by thread: Re: Create empty files?
- Next by thread: Re: Create empty files?