diff --git a/file.c b/file.c index 49aeca06c9fffc8b058fb467eb27abfb07271a2a..50c491c431ce1aba14016f074d2b52d7a19d9653 100644 --- a/file.c +++ b/file.c @@ -955,6 +955,8 @@ struct ast_filestream *ast_writefile(const char *filename, const char *type, con fs->filename = strdup(filename); } fs->vfs = NULL; + /* If truncated, we'll be at the beginning; if not truncated, then append */ + f->seek(fs, 0, SEEK_END); } else { ast_log(LOG_WARNING, "Unable to rewrite %s\n", fn); close(fd);