diff options
| author | ruki <[email protected]> | 2022-08-31 22:39:10 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-08-31 22:39:10 +0800 |
| commit | 44d9b7cd8ef84a84bd8d898dddc419c385e02daf (patch) | |
| tree | 045b46d2029d30f092494887f8857bccc72cd5a2 /core/src | |
| parent | df6efbec2309e41c67e6ffdc8386a600ca04c21d (diff) | |
improve os.cpfile
Diffstat (limited to 'core/src')
| m--------- | core/src/tbox/tbox | 0 | ||||
| -rw-r--r-- | core/src/xmake/os/cpfile.c | 8 |
2 files changed, 7 insertions, 1 deletions
diff --git a/core/src/tbox/tbox b/core/src/tbox/tbox -Subproject 4ab2cdf8dc94402d2277fd71ddc11eae913a30d +Subproject 6e4eab7e07a2b535af6889de3f62cfec0384e99 diff --git a/core/src/xmake/os/cpfile.c b/core/src/xmake/os/cpfile.c index 4490172da..153f51de0 100644 --- a/core/src/xmake/os/cpfile.c +++ b/core/src/xmake/os/cpfile.c @@ -43,7 +43,13 @@ tb_int_t xm_os_cpfile(lua_State* lua) tb_char_t const* dst = luaL_checkstring(lua, 2); tb_check_return_val(src && dst, 0); + // init copy flags + tb_size_t flags = TB_FILE_COPY_NONE; + tb_bool_t is_symlink = lua_toboolean(lua, 3); + if (is_symlink) + flags |= TB_FILE_COPY_LINK; + // do copy - lua_pushboolean(lua, tb_file_copy(src, dst)); + lua_pushboolean(lua, tb_file_copy(src, dst, flags)); return 1; } |
