Write/create/truncate prototxt when saving to fix #341
Write/create/truncate prototxt when saving to fix #341

WriteProtoToTextFile now saves the prototxt whether or not the file
already exists and sets the permissions to owner read/write and group +
other read.

Thanks @beam2d and @chyh1990 for pointing out the open modes bug.

wangg12/caffe,yikeliu/caffe-future,dculibrk/boosted_pooling,nicodjimenez/caffe,tackgeun/caffe,tackgeun/caffe,shiquanwang/caffe,liuxianming/caffe_feedback,nicodjimenez/caffe,gnina/gnina,gnina/gnina,yikeliu/caffe-future,vibhav-vineet/caffe,vibhav-vineet/caffe,vibhav-vineet/caffe,nicodjimenez/caffe,xidianwlc/caffe,CZCV/s-dilation-caffe,longjon/caffe,orentadmor/caffe,gogartom/caffe-textmaps,minghuam/caffe,yikeliu/caffe-future,dculibrk/boosted_pooling,orentadmor/caffe,gnina/gnina,flickr/caffe,liuxianming/caffe_feedback,liuxianming/caffe_feedback,vibhav-vineet/caffe,longjon/caffe,gogartom/caffe-textmaps,flickr/caffe,wangg12/caffe,suixudongi8/caffe,sichenucsd/caffe_si,tackgeun/caffe,xidianwlc/caffe,liuxianming/caffe_feedback,nicodjimenez/caffe,minghuam/caffe,shiquanwang/caffe,minghuam/caffe,longjon/caffe,CZCV/s-dilation-caffe,dculibrk/boosted_pooling,dculibrk/boosted_pooling,suixudongi8/caffe,CZCV/s-dilation-caffe,gnina/gnina,sichenucsd/caffe_si,shiquanwang/caffe,gogartom/caffe-textmaps,wangg12/caffe,nicodjimenez/caffe,suixudongi8/caffe,xidianwlc/caffe,shiquanwang/caffe,minghuam/caffe,sichenucsd/caffe_si,gnina/gnina,wangg12/caffe,sichenucsd/caffe_si,yikeliu/caffe-future,CVML/sds_eccv2014,bharath272/sds_eccv2014,gnina/gnina,orentadmor/caffe,flickr/caffe,tackgeun/caffe,liuxianming/caffe_feedback,xidianwlc/caffe,orentadmor/caffe,longjon/caffe,dculibrk/boosted_pooling,gogartom/caffe-textmaps,flickr/caffe,CZCV/s-dilation-caffe,flickr/caffe,suixudongi8/caffe