Permalink
Browse files

fs, bugfix: change fs.copy to async mode.

  • Loading branch information...
xicilion committed Oct 17, 2017
1 parent 880f894 commit 6253b8a13d96ee99de29911d01959d401a799fc5
Showing with 6 additions and 0 deletions.
  1. +3 −0 fibjs/src/fs/fs_posix.cpp
  2. +3 −0 fibjs/src/fs/fs_win32.cpp
@@ -298,6 +298,9 @@ result_t fs_base::rename(exlib::string from, exlib::string to,
result_t fs_base::copy(exlib::string from, exlib::string to, AsyncEvent* ac)
{
if (ac->isSync())
return CHECK_ERROR(CALL_E_NOSYNC);
int input, output;
if ((input = ::open(from.c_str(), O_RDONLY)) == -1)
return CHECK_ERROR(LastError());
@@ -569,6 +569,9 @@ result_t fs_base::rename(exlib::string from, exlib::string to, AsyncEvent* ac)
result_t fs_base::copy(exlib::string from, exlib::string to, AsyncEvent* ac)
{
if (ac->isSync())
return CHECK_ERROR(CALL_E_NOSYNC);
if (!CopyFileW(UTF8_W(from), UTF8_W(to), TRUE))
return CHECK_ERROR(LastError());

0 comments on commit 6253b8a

Please sign in to comment.