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

Re: Growisofs input cache (get away from dd?)



>>>> source code: growisofs -Z /dev/cdrom=/dev/fd/0 < image.iso. Ta-dah...
> David Weisgerber:
>> I think that using the pipe will create another buffer 
>> which I want to avoid.
> 
> This is not a pipe. It is an inherited file
> descriptor.
> man bash says:
> 
>   Redirecting Input
>     Redirection of input causes the file whose name results from the expan-
>     sion  of  word  to  be  opened for reading on file descriptor n, or the
>     standard input (file descriptor 0) if n is not specified.
>     The general format for redirecting input is:
>           [n]<word

Right. One can also do

exec 3 < image.iso
growisofs -Z /dev/cdrom1=/dev/fd/3 &
growisofs -Z /dev/cdrom2=/dev/fd/3 &
...

and whatever equivalent in C, i.e. open once, pass to many. It is *as
good* as letting growisofs open it. Actually *better*, because it's not
subject to race condition. You only have to make sure that the file is
opened with O_LARGEFILE or with open64. Some script interpretators might
fail to. A.


Reply to: