"use strict";(self.webpackChunkdocs_site=self.webpackChunkdocs_site||[]).push([[7628],{8357:(e,n,l)=>{l.r(n),l.d(n,{assets:()=>c,contentTitle:()=>t,default:()=>u,frontMatter:()=>o,metadata:()=>i,toc:()=>d});const i=JSON.parse('{"id":"XXTLanControl.lua/web-file/remove_line","title":"\u5220\u9664\u5355\u884c (LCC.web_file.remove_line)","description":"\u58f0\u660e","source":"@site/docs/XXTLanControl.lua/web-file/remove_line.md","sourceDirName":"XXTLanControl.lua/web-file","slug":"/XXTLanControl.lua/web-file/remove_line","permalink":"/docs/XXTLanControl.lua/web-file/remove_line","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":240,"frontMatter":{"sidebar_position":240},"sidebar":"tutorialSidebar","previous":{"title":"\u5220\u9664\u884c\u533a\u95f4 (LCC.web_file.remove_lines)","permalink":"/docs/XXTLanControl.lua/web-file/remove_lines"},"next":{"title":"\u62f7\u8d1d\u4e2d\u63a7\u6587\u4ef6/\u76ee\u5f55 (LCC.web_file.copy)","permalink":"/docs/XXTLanControl.lua/web-file/copy"}}');var r=l(4848),s=l(8453);const o={sidebar_position:240},t="\u5220\u9664\u5355\u884c (LCC.web_file.remove_line)",c={},d=[{value:"\u58f0\u660e",id:"\u58f0\u660e",level:2},{value:"\u53c2\u6570",id:"\u53c2\u6570",level:2},{value:"\u8fd4\u56de\u503c",id:"\u8fd4\u56de\u503c",level:2},{value:"\u8bf4\u660e",id:"\u8bf4\u660e",level:2},{value:"\u793a\u4f8b",id:"\u793a\u4f8b",level:2}];function a(e){const n={blockquote:"blockquote",br:"br",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"\u5220\u9664\u5355\u884c-lccweb_fileremove_line",children:"\u5220\u9664\u5355\u884c (LCC.web_file.remove_line)"})}),"\n",(0,r.jsx)(n.h2,{id:"\u58f0\u660e",children:"\u58f0\u660e"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-lua",children:"line, err = LCC.web_file.remove_line(path, line_number, timeout?)\n"})}),"\n",(0,r.jsx)(n.h2,{id:"\u53c2\u6570",children:"\u53c2\u6570"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["path",(0,r.jsx)(n.br,{}),"\n","\u5b57\u7b26\u4e32\u578b\uff0c\u76ee\u6807\u6587\u4ef6\u8def\u5f84"]}),"\n",(0,r.jsxs)(n.li,{children:["line_number",(0,r.jsx)(n.br,{}),"\n","\u6570\u503c\u578b\uff0c\u8981\u5220\u9664\u7684\u884c\u53f7\uff1b\u6b63\u6570\u4ece ",(0,r.jsx)(n.code,{children:"1"})," \u8d77\u7b97\uff0c\u8d1f\u6570\u4ece\u672b\u5c3e\u5012\u6570\uff08",(0,r.jsx)(n.code,{children:"-1"})," \u4e3a\u6700\u540e\u4e00\u884c\uff09\uff0c",(0,r.jsx)(n.code,{children:"0"})," \u8868\u793a\u672b\u884c\u4e4b\u540e"]}),"\n",(0,r.jsxs)(n.li,{children:["timeout",(0,r.jsx)(n.br,{}),"\n","\u6570\u503c\u578b\uff0c\u53ef\u9009\uff1b\u8bf7\u6c42\u8d85\u65f6\u65f6\u95f4\uff08\u79d2\uff09\uff0c\u9ed8\u8ba4 ",(0,r.jsx)(n.code,{children:"60"})]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"\u8fd4\u56de\u503c",children:"\u8fd4\u56de\u503c"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["line",(0,r.jsx)(n.br,{}),"\n","\u5b57\u7b26\u4e32\u578b\uff0c\u88ab\u5220\u9664\u7684\u884c\u5185\u5bb9\uff1b\u5931\u8d25\u65f6\u4e3a ",(0,r.jsx)(n.code,{children:"nil"})]}),"\n",(0,r.jsxs)(n.li,{children:["err",(0,r.jsx)(n.br,{}),"\n","\u5b57\u7b26\u4e32\u578b\u6216 ",(0,r.jsx)(n.code,{children:"nil"}),"\uff0c\u5931\u8d25\u65f6\u7684\u9519\u8bef\u63cf\u8ff0"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"\u8bf4\u660e",children:"\u8bf4\u660e"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:["\u5220\u9664\u6307\u5b9a\u884c\u53f7\u7684\u5355\u884c\uff0c\u5e76\u8fd4\u56de\u8be5\u884c\u539f\u59cb\u6587\u672c\u3002",(0,r.jsx)(n.br,{}),"\n","\u884c\u53f7\u89c4\u5219\u8be6\u89c1\u4e0a\u65b9\u53c2\u6570\u8bf4\u660e\u3002",(0,r.jsx)(n.br,{}),"\n","\u6ca1\u6709\u5220\u9664\u5230\u5185\u5bb9\u65f6\u8fd4\u56de ",(0,r.jsx)(n.code,{children:"nil"}),"\u3002"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"\u793a\u4f8b",children:"\u793a\u4f8b"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-lua",children:'local line, err = LCC.web_file.remove_line("/\u914d\u7f6e/list.txt", 1)\nif line then\n    print("\u79fb\u9664: " .. line)\nend\n'})})]})}function u(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},8453:(e,n,l)=>{l.d(n,{R:()=>o,x:()=>t});var i=l(6540);const r={},s=i.createContext(r);function o(e){const n=i.useContext(s);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function t(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]);