Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / native_client_sdk / src / libraries / nacl_io / html5fs / html5_fs.cc
index 64a1f47..0d52bee 100644 (file)
@@ -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()