throw common::UnknownException("Unknown error while creating temp directory.");
}
- if(EINA_TRUE != ecore_file_cp(attPath.c_str(), tmpPath.c_str())) {
- throw common::UnknownException("Unknown error while copying file to temp.");
+ FILE *f1, *f2;
+ size_t num;
+ int ret = 1;
+
+ f1 = fopen(attPath.c_str(), "rb");
+ if (!f1) {
+ LoggerE("Fail open attPath");
+ return 0;
+ }
+ f2 = fopen(tmpPath.c_str(), "wb");
+ if (!f2) {
+ LoggerE("Fail open tmpPath");
+ fclose (f1);
+ return 0;
+ }
+
+ while ((num = fread(buf, 1, sizeof(buf), f1)) > 0) {
+ if (fwrite(buf, 1, num, f2) != num)
+ ret = 0;
+ }
+
+ fclose (f1);
+ fclose (f2);
+
+ if(EINA_TRUE != ret /*ecore_file_cp(attPath.c_str(), tmpPath.c_str())*/) {
+ std::string error = "Unknown error while copying file to temp. ";
+ throw common::UnknownException(error.c_str());
}
return dirPath;
_uriPrefix = 'file://',
i;
if (aPath.indexOf(_uriPrefix) === 0) {
- _fileRealPath = aPath; /*.substr(_uriPrefix.length);*/
+ _fileRealPath = aPath.substr(_uriPrefix.length);
} else if (aPath[0] != '/') {
//virtual path$
var _pathTokens = aPath.split('/');
function Message(type, data) {
if (!(this instanceof Message)) {
- return new Message(type, data);
+ throw new TypeError("Constructor called like a function");
}
if (MessageServiceTag.indexOf(type) === -1) {
throw new tizen.WebAPIException(tizen.WebAPIException.TYPE_MISMATCH_ERR);
{name: 'opId', type: types_.LONG}
]);
+ if(arguments.opId === undefined){
+ throw new tizen.WebAPIException(tizen.WebAPIException.TYPE_MISMATCH_ERR);
+ }
+
var self = this;
bridge.sync({
cmd: 'MessageService_stopSync',