Revision
14896
Author
anthm
Date
2009-09-16 17:25:21 -0500 (Wed, 16 Sep 2009)

Log Message

BOUNTY-9 (regression)

Modified Paths

Diff

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);