Hi!

1. I have a file NOT in msg format. It has a few extra lines before
headers. I have to skip these lines and open it as message.

Now I'm doing so:
- create stream from my dirty file: mu_file_stream_create()
- open this stream: mu_stream_open()
- do do-while loop and skip extra lines via:
mu_stream_sequential_readline(), search cut-line and break.
- create memory empty stream: mu_memory_stream_create()
- poured from the file-stream into the inmemory-stream without extra lines:
 while with mu_stream_sequential_read() and mu_stream_sequential_write()
- close and destroy file stream: mu_stream_close() and mu_stream_destroy
- create empty msg: mu_message_create()
- create msg from inmemory-stream (which has no extra lines and in msg
forman now): mu_message_set_stream()
- and work with message from inmemory-stream.

My question is: is this the correct way to solve the issue or is there
another more simple way to skip extra lines?

2. I think that in my application has memory leak. After I finished working
with message opened from inmemory-stream, I'm doing close and destroy
inmemory-stream: mu_stream_close() and mu_stream_destroy(). Is this correct?

=kostik



_______________________________________________
Bug-mailutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-mailutils

Reply via email to