Modified: freeswitch/trunk/src/switch_core_file.c (14895 => 14896)
--- freeswitch/trunk/src/switch_core_file.c 2009-09-16 22:19:36 UTC (rev 14895)
+++ freeswitch/trunk/src/switch_core_file.c 2009-09-16 22:25:21 UTC (rev 14896)
@@ -148,7 +148,9 @@
switch_goto_status(status, end);
}
- if (!strstr(file_path, SWITCH_URL_SEPARATOR) && (status = switch_file_exists(file_path, fh->memory_pool)) != SWITCH_STATUS_SUCCESS) {
+
+ if ((flags & SWITCH_FILE_FLAG_WRITE) &&
+ !strstr(file_path, SWITCH_URL_SEPARATOR) && (status = switch_file_exists(file_path, fh->memory_pool)) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "File [%s] not created!\n", file_path);
fh->file_interface->file_close(fh);
UNPROTECT_INTERFACE(fh->file_interface);