"use strict";(self.webpackChunkdocs_site=self.webpackChunkdocs_site||[]).push([[1982],{8453:(e,r,n)=>{n.d(r,{R:()=>s,x:()=>o});var t=n(6540);const i={},l=t.createContext(i);function s(e){const r=t.useContext(l);return t.useMemo(function(){return"function"==typeof e?e(r):{...r,...e}},[r,e])}function o(e){let r;return r=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:s(e.components),t.createElement(l.Provider,{value:r},e.children)}},8781:(e,r,n)=>{n.r(r),n.d(r,{assets:()=>a,contentTitle:()=>o,default:()=>u,frontMatter:()=>s,metadata:()=>t,toc:()=>c});const t=JSON.parse('{"id":"XXTLanControl.lua/web-file/mkdir","title":"Create A Controller Directory (LCC.web_file.mkdir)","description":"Signature","source":"@site/i18n/en/docusaurus-plugin-content-docs/current/XXTLanControl.lua/web-file/mkdir.md","sourceDirName":"XXTLanControl.lua/web-file","slug":"/XXTLanControl.lua/web-file/mkdir","permalink":"/docs/en/XXTLanControl.lua/web-file/mkdir","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":20,"frontMatter":{"sidebar_position":20},"sidebar":"tutorialSidebar","previous":{"title":"List Files On The Controller (LCC.web_file.list)","permalink":"/docs/en/XXTLanControl.lua/web-file/list"},"next":{"title":"Delete Files Or Directories (LCC.web_file.delete)","permalink":"/docs/en/XXTLanControl.lua/web-file/delete"}}');var i=n(4848),l=n(8453);const s={sidebar_position:20},o="Create A Controller Directory (LCC.web_file.mkdir)",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 r={blockquote:"blockquote",br:"br",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,l.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.header,{children:(0,i.jsx)(r.h1,{id:"create-a-controller-directory-lccweb_filemkdir",children:"Create A Controller Directory (LCC.web_file.mkdir)"})}),"\n",(0,i.jsx)(r.h2,{id:"signature",children:"Signature"}),"\n",(0,i.jsx)(r.pre,{children:(0,i.jsx)(r.code,{className:"language-lua",children:"ok, err = LCC.web_file.mkdir(path, timeout?)\n"})}),"\n",(0,i.jsx)(r.h2,{id:"parameters",children:"Parameters"}),"\n",(0,i.jsxs)(r.ul,{children:["\n",(0,i.jsxs)(r.li,{children:["path",(0,i.jsx)(r.br,{}),"\n","String. Directory to create."]}),"\n",(0,i.jsxs)(r.li,{children:["timeout",(0,i.jsx)(r.br,{}),"\n","Number, optional. Request timeout in seconds, default ",(0,i.jsx)(r.code,{children:"60"}),"."]}),"\n"]}),"\n",(0,i.jsx)(r.h2,{id:"returns",children:"Returns"}),"\n",(0,i.jsxs)(r.ul,{children:["\n",(0,i.jsxs)(r.li,{children:["ok",(0,i.jsx)(r.br,{}),"\n","Boolean. ",(0,i.jsx)(r.code,{children:"true"})," on success, ",(0,i.jsx)(r.code,{children:"false"})," on failure."]}),"\n",(0,i.jsxs)(r.li,{children:["err",(0,i.jsx)(r.br,{}),"\n","String or ",(0,i.jsx)(r.code,{children:"nil"}),". Error description when the operation fails."]}),"\n"]}),"\n",(0,i.jsx)(r.h2,{id:"notes",children:"Notes"}),"\n",(0,i.jsxs)(r.blockquote,{children:["\n",(0,i.jsxs)(r.p,{children:["Creates a directory, including any missing parent directories.",(0,i.jsx)(r.br,{}),"\n","When the directory already exists the call is still considered successful.",(0,i.jsx)(r.br,{}),"\n","Any controller-side error text is forwarded unchanged."]}),"\n"]}),"\n",(0,i.jsx)(r.h2,{id:"example",children:"Example"}),"\n",(0,i.jsx)(r.pre,{children:(0,i.jsx)(r.code,{className:"language-lua",children:'local ok, err = LCC.web_file.mkdir("/backups", 30)\nif not ok then\n    LCC.log(2, "Failed to create directory", err)\nend\n'})})]})}function u(e={}){const{wrapper:r}={...(0,l.R)(),...e.components};return r?(0,i.jsx)(r,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}}}]);