X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fnative_client_sdk%2Fsrc%2Flibraries%2Fnacl_io%2Fhtml5fs%2Fhtml5_fs.cc;h=0d52bee1b0ad32a8902acfe43eb0ecc260ed083e;hb=ff3e2503a20db9193d323c1d19c38c68004dec4a;hp=64a1f4724e65755d4ffe246d434dc024d3eadf9a;hpb=7338fba38ba696536d1cc9d389afd716a6ab2fe6;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/native_client_sdk/src/libraries/nacl_io/html5fs/html5_fs.cc b/src/native_client_sdk/src/libraries/nacl_io/html5fs/html5_fs.cc index 64a1f47..0d52bee 100644 --- a/src/native_client_sdk/src/libraries/nacl_io/html5fs/html5_fs.cc +++ b/src/native_client_sdk/src/libraries/nacl_io/html5fs/html5_fs.cc @@ -75,8 +75,7 @@ Error Html5Fs::Mkdir(const Path& path, int permissions) { return ENOENT; int32_t result = ppapi()->GetFileRefInterface()->MakeDirectory( - fileref_resource.pp_resource(), PP_MAKEDIRECTORYFLAG_NONE, - PP_BlockUntilComplete()); + fileref_resource.pp_resource(), PP_FALSE, PP_BlockUntilComplete()); if (result != PP_OK) return PPErrorToErrno(result); @@ -117,7 +116,20 @@ Error Html5Fs::Rename(const Path& path, const Path& newpath) { if (!fileref_resource.pp_resource()) return ENOENT; - return EACCES; + ScopedResource new_fileref_resource( + ppapi(), + ppapi()->GetFileRefInterface()->Create(filesystem_resource_, + newpath.Join().c_str())); + if (!new_fileref_resource.pp_resource()) + return ENOENT; + + int32_t result = ppapi()->GetFileRefInterface()->Rename( + fileref_resource.pp_resource(), new_fileref_resource.pp_resource(), + PP_BlockUntilComplete()); + if (result != PP_OK) + return PPErrorToErrno(result); + + return 0; } Html5Fs::Html5Fs()