bug-bash
[Top][All Lists]
Advanced

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

Re: lseek with bash


From: Chet Ramey
Subject: Re: lseek with bash
Date: Fri, 09 Dec 2011 16:35:11 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:8.0) Gecko/20111105 Thunderbird/8.0

On 12/9/11 10:12 AM, Jean-Jacques Brucker wrote:
> Playing with flock to securely access to a file shared by multiple
> process. I noticed there are no documented way to do an lseek on an
> opened fd with bash :
        [...]
> I have solve my problem by making this small binary (i just needed a rewind) :
> 
> int main(int argc,char * argv[]) { return lseek(atoi(argv[1]),0L,0); }
> 
> But i ll be glad to use a standard and finished tool.
> 
> Of course we could make an "lseek" binary with some options to cover
> all use cases of lseek function. But I prefer to have such
> functionality inside bash.

ksh93 has this functionality with different syntax.  I'm not convinced
it's of general enough value to add to bash, especially when a separate
binary (of obviously trivial complexity) does the job.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]