[asterisk-bugs] [Asterisk 0016461]: [patch] for reading and writing to text file

Asterisk Bug Tracker noreply at bugs.digium.com
Wed May 26 09:52:57 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=16461 
====================================================================== 
Reported By:                skyman
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   16461
Category:                   Functions/NewFeature
Reproducibility:            N/A
Severity:                   feature
Priority:                   normal
Status:                     feedback
Asterisk Version:           1.6.1.11 
JIRA:                       SWP-1478 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2009-12-17 09:55 CST
Last Modified:              2010-05-26 09:52 CDT
====================================================================== 
Summary:                    [patch] for reading and writing to text file
Description: 
this patch adds 7 functions in func_env :
FILE_FORMAT
FILE_COUNT_LINE
FILE_READ_LINE
FILE_WRITE
FILE_WRITE_LINE
FILE_APPEND
FILE_APPEND_LINE
====================================================================== 

---------------------------------------------------------------------- 
 (0122480) tilghman (administrator) - 2010-05-26 09:52
 https://issues.asterisk.org/view.php?id=16461#c122480 
---------------------------------------------------------------------- 
The read2 API call uses an ast_str dynamic buffer structure for the result,
instead of relying on a static buffer passed into the function.  This
allows the buffer to start out much smaller and to grow as necessary, which
is more memory-efficient for the common case, but also allows much larger
values to be processed in the exceptional case.

My suggestion for the arguments would be:
FILE(name,[L]offset,[L]length,file-format),
such that prefixing the offset with the 'L' character specifies the offset
is to be interpreted as a line number, and that prefixing the length
argument with an 'L' character specifies the number of lines to be read.  I
agree with your specification of the file-format, though, possibly, the
default should agree with the platform (i.e. on Cygwin, the default should
be 'dos'). 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-05-26 09:52 tilghman       Note Added: 0122480                          
======================================================================




More information about the asterisk-bugs mailing list