"use strict";(self.webpackChunkdocs_site=self.webpackChunkdocs_site||[]).push([[2009],{5812:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>a,contentTitle:()=>l,default:()=>u,frontMatter:()=>o,metadata:()=>s,toc:()=>c});const s=JSON.parse('{"id":"XXTLanControl.lua/web-file/move_merge","title":"Move And Merge Missing Items (LCC.web_file.move_merge)","description":"Signature","source":"@site/i18n/en/docusaurus-plugin-content-docs/current/XXTLanControl.lua/web-file/move_merge.md","sourceDirName":"XXTLanControl.lua/web-file","slug":"/XXTLanControl.lua/web-file/move_merge","permalink":"/docs/en/XXTLanControl.lua/web-file/move_merge","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":310,"frontMatter":{"sidebar_position":310},"sidebar":"tutorialSidebar","previous":{"title":"Move And Overwrite (LCC.web_file.move_overwrite)","permalink":"/docs/en/XXTLanControl.lua/web-file/move_overwrite"},"next":{"title":"Move With Overwrite-And-Merge (LCC.web_file.move_overwrite_merge)","permalink":"/docs/en/XXTLanControl.lua/web-file/move_overwrite_merge"}}');var i=r(4848),t=r(8453);const o={sidebar_position:310},l="Move And Merge Missing Items (LCC.web_file.move_merge)",a={},c=[{value:"Signature",id:"signature",level:2},{value:"Parameters",id:"parameters",level:2},{value:"Returns",id:"returns",level:2},{value:"Notes",id:"notes",level:2},{value:"Example",id:"example",level:2}];function d(e){const n={blockquote:"blockquote",br:"br",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,t.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.header,{children:(0,i.jsx)(n.h1,{id:"move-and-merge-missing-items-lccweb_filemove_merge",children:"Move And Merge Missing Items (LCC.web_file.move_merge)"})}),"\n",(0,i.jsx)(n.h2,{id:"signature",children:"Signature"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"ok, err = LCC.web_file.move_merge(src, target, timeout?)\n"})}),"\n",(0,i.jsx)(n.h2,{id:"parameters",children:"Parameters"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["src",(0,i.jsx)(n.br,{}),"\n","String. Source path."]}),"\n",(0,i.jsxs)(n.li,{children:["target",(0,i.jsx)(n.br,{}),"\n","String. Destination path."]}),"\n",(0,i.jsxs)(n.li,{children:["timeout",(0,i.jsx)(n.br,{}),"\n","Number, optional. Request timeout in seconds, default ",(0,i.jsx)(n.code,{children:"60"}),"."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"returns",children:"Returns"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["ok",(0,i.jsx)(n.br,{}),"\n","Boolean. ",(0,i.jsx)(n.code,{children:"true"})," on success, ",(0,i.jsx)(n.code,{children:"nil"})," on failure."]}),"\n",(0,i.jsxs)(n.li,{children:["err",(0,i.jsx)(n.br,{}),"\n","String or ",(0,i.jsx)(n.code,{children:"nil"}),". Error description when the move fails."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"notes",children:"Notes"}),"\n",(0,i.jsxs)(n.blockquote,{children:["\n",(0,i.jsxs)(n.p,{children:["Shorthand for ",(0,i.jsx)(n.code,{children:"web_file.move"})," with ",(0,i.jsx)(n.code,{children:'mode = "merge"'}),".",(0,i.jsx)(n.br,{}),"\n","Keeps existing files at the destination and only moves missing ones."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'local ok, err = LCC.web_file.move_merge("/assets/temp", "/assets/live")\nif not ok then\n    error(err)\nend\n'})})]})}function u(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>o,x:()=>l});var s=r(6540);const i={},t=s.createContext(i);function o(e){const n=s.useContext(t);return s.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),s.createElement(t.Provider,{value:n},e.children)}}}]);