[asterisk-dev] temporary file names for monitor files

Octavio Ruiz tacvbo at tacvbo.net
Tue Jun 3 12:02:56 CDT 2008


On Fri, May 30, 2008 at 5:48 AM, Sherwood McGowan
<sherwood.mcgowan at gmail.com> wrote:
> Tzafrir Cohen wrote:
>> On Thu, May 29, 2008 at 05:24:48PM -0500, John Lange wrote:
> As I read it (pardon me if I'm misunderstanding your question), he wants
> the .tmp or .part to be removed from the filename after the file is
> finished being written to, thereby allowing a simpler method of knowing
> when the file is completed being written to.

Right now what I do is run a lsof inside a script in order to know if
a file descriptor is opened for that file but perhaps use
cache_record_files and record_cache_dir  from asterisk.conf instead
would be a better idea.

> I haven't tested in depth, but I believe that the file is created but
> does not have data in it until after the call is completed, but still we
> don't want to modify/copy/move the file until after it's finished being
> written to. Since you're not sure when the file is done being modified
> by Asterisk, the only thing you can do is check for a modification time
> that is more than x seconds/minutes in the past and then do what you
> wish to do to the file.

lsof will list you all open files.

Regards,

-- 
Octavio H. Ruiz Cervera
Tel.: (+52 55) 8590-9000 Ext. 7016
Mobile: (+52 1 55) 14-087790
Mobile: (+52 1 55) 41-351242



More information about the asterisk-dev mailing list