Re: random file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Sun, 2008-06-22 at 14:14 -0400, Mag Gam wrote:
> even seeking thru it requires a sequential  scan, right?

If Linux FS systems work like real *IX, it depends. The underlying
C/system calls should be smart enough to calculate an offset that
traverses inode information to cause a direct access seek of the read
write head.

If you use a utility, it depends on if the utility is smart enough to
use the correct system calls or just does a sequential read until the
proper location is achieved. I *suspect* that most utilities are smart
enough to work the "fast" way.

You can test this for various utilities or applications.

For instance

    dd if=<your file name> skip=<some large number> of=/dev/null count=1

should return *very* quickly. If not, that means it is stupid.

For output, the same. Just replace skip with seek.

Think of large database handlers. If they had to process sequentially,
there would be no fast ones unless the whole DB was cached.

> <snip>

> On Sun, Jun 22, 2008 at 1:57 PM, Frank Cox <theatre@xxxxxxxxxxx>
> wrote:
>         On Sun, 22 Jun 2008 11:20:22 -0400
>         Mag Gam <magawake@xxxxxxxxx> wrote:
>         
>         > Is it possible to create a file on a random inode on a file
>         system?
>         
>         
>         Wouldn't it be easier (and safer) to create a large file, then
>         seek within it?
>         <snip sig stuff>

HTH
-- 
Bill

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux