Post subject: Absolutely basic question.
PostPosted: Thu Nov 05, 2009 11:50 am 
   
One that a newbie wouldn't even ask! A little knowledge is a dangerous
thing.

When a temporary file is given a hex or similar number (e.g. Charlie's
~/tmp/virtual-charlie.3HNF1Z,) where does the number come from? Is it
random? One program I have uses timestamps as directory names, because the
timestamp is critical. What about the rest?

Doug.


 
 Post subject: Re: Absolutely basic question.
PostPosted: Thu Nov 05, 2009 3:51 pm 
Doug Laidlaw writes:

Quote:
One that a newbie wouldn't even ask! A little knowledge is a dangerous
thing.

When a temporary file is given a hex or similar number (e.g. Charlie's
~/tmp/virtual-charlie.3HNF1Z,) where does the number come from? Is it
random? One program I have uses timestamps as directory names, because the
timestamp is critical. What about the rest?

Probably /dev/urandom run through base64
I believe bash has a variable which does that.




>Doug.


 
 Post subject: Re: Absolutely basic question.
PostPosted: Thu Nov 05, 2009 7:48 pm 
Doug Laidlaw wrote:

Quote:
One that a newbie wouldn't even ask! A little knowledge is a dangerous
thing.

When a temporary file is given a hex or similar number (e.g. Charlie's
~/tmp/virtual-charlie.3HNF1Z,) where does the number come from? Is it
random? One program I have uses timestamps as directory names, because
the
timestamp is critical. What about the rest?

I think it's a very good question. Sometimes the seemingly basic things get
by you and years later you think it's too basic to query.

I've looked at ls listings for years and never thought to question what the
"total" actually means.

~]$ ls -l
total 213952

Still not sure and google didn't pin it down either

It doesn't seem to refer directly to file numbers or bytes.

Another one I have noticed is the results of a forced fsck

The listing show something like files 573540/3875476 blocks 34986/39458798.

I think just what does that mean; two sets of numbers for each files and
blocks.

These all become little project to look up "one day" but it never happens.

--
faeychild
Running kde on 2.6.29.6-desktop-2mnb kernel.
Mandriva Linux release 2009.1 (Official) for i586


 
 Post subject: Re: Absolutely basic question.
PostPosted: Fri Nov 06, 2009 2:23 am 
On Thu, 05 Nov 2009 06:48:34 -0500, faeychild wrote:

Quote:
Doug Laidlaw wrote:
When a temporary file is given a hex or similar number (e.g. Charlie's
~/tmp/virtual-charlie.3HNF1Z,) where does the number come from? Is it

See "man mktemp", and try running "strace -f -v mktemp". It's reading
from /dev/urandom.

Quote:
I've looked at ls listings for years and never thought to question what the
"total" actually means.
~]$ ls -l
total 213952

From "info ls" ...
For each directory that is listed, preface the files with a line
`total BLOCKS', where BLOCKS is the total disk allocation for all
files in that directory. The block size currently defaults to 1024
bytes, but this can be overridden (*note Block size::). The
BLOCKS computed counts each hard link separately; this is arguably
a deficiency.

Regards, Dave Hodgins

--
Change nomail.afraid.org to ody.ca to reply by email.
(nomail.afraid.org has been set up specifically for
use in usenet. Feel free to use it yourself.)


 





SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list
 © 0x61.com 2009 - Internet Forums and much more! - All rights reserved.