"use strict";(self.webpackChunkdocs_site=self.webpackChunkdocs_site||[]).push([[5725],{8453:(e,n,l)=>{l.d(n,{R:()=>o,x:()=>r});var i=l(6540);const t={},s=i.createContext(t);function o(e){const n=i.useContext(s);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),i.createElement(s.Provider,{value:n},e.children)}},9144:(e,n,l)=>{l.r(n),l.d(n,{assets:()=>c,contentTitle:()=>r,default:()=>u,frontMatter:()=>o,metadata:()=>i,toc:()=>d});const i=JSON.parse('{"id":"XXTLanControl.lua/web-file/line_count","title":"\u7edf\u8ba1\u6587\u4ef6\u884c\u6570 (LCC.web_file.line_count)","description":"\u58f0\u660e","source":"@site/docs/XXTLanControl.lua/web-file/line_count.md","sourceDirName":"XXTLanControl.lua/web-file","slug":"/XXTLanControl.lua/web-file/line_count","permalink":"/docs/XXTLanControl.lua/web-file/line_count","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":150,"frontMatter":{"sidebar_position":150},"sidebar":"tutorialSidebar","previous":{"title":"\u8bfb\u53d6\u6587\u4ef6\u4e3a\u884c\u6570\u7ec4 (LCC.web_file.get_lines)","permalink":"/docs/XXTLanControl.lua/web-file/get_lines"},"next":{"title":"\u8986\u5199\u591a\u884c\u6587\u672c (LCC.web_file.set_lines)","permalink":"/docs/XXTLanControl.lua/web-file/set_lines"}}');var t=l(4848),s=l(8453);const o={sidebar_position:150},r="\u7edf\u8ba1\u6587\u4ef6\u884c\u6570 (LCC.web_file.line_count)",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,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"\u7edf\u8ba1\u6587\u4ef6\u884c\u6570-lccweb_fileline_count",children:"\u7edf\u8ba1\u6587\u4ef6\u884c\u6570 (LCC.web_file.line_count)"})}),"\n",(0,t.jsx)(n.h2,{id:"\u58f0\u660e",children:"\u58f0\u660e"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"count, err = LCC.web_file.line_count(path, timeout?)\n"})}),"\n",(0,t.jsx)(n.h2,{id:"\u53c2\u6570",children:"\u53c2\u6570"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["path",(0,t.jsx)(n.br,{}),"\n","\u5b57\u7b26\u4e32\u578b\uff0c\u8981\u7edf\u8ba1\u7684\u6587\u4ef6\u8def\u5f84"]}),"\n",(0,t.jsxs)(n.li,{children:["timeout",(0,t.jsx)(n.br,{}),"\n","\u6570\u503c\u578b\uff0c\u53ef\u9009\uff1b\u8bf7\u6c42\u8d85\u65f6\u65f6\u95f4\uff08\u79d2\uff09\uff0c\u9ed8\u8ba4 ",(0,t.jsx)(n.code,{children:"60"})]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"\u8fd4\u56de\u503c",children:"\u8fd4\u56de\u503c"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["count",(0,t.jsx)(n.br,{}),"\n","\u6570\u503c\u578b\uff0c\u6587\u672c\u884c\u6570\uff1b\u5931\u8d25\u65f6\u8fd4\u56de ",(0,t.jsx)(n.code,{children:"nil"})]}),"\n",(0,t.jsxs)(n.li,{children:["err",(0,t.jsx)(n.br,{}),"\n","\u5b57\u7b26\u4e32\u578b\u6216 ",(0,t.jsx)(n.code,{children:"nil"}),"\uff0c\u5931\u8d25\u65f6\u7684\u9519\u8bef\u63cf\u8ff0"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"\u8bf4\u660e",children:"\u8bf4\u660e"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["\u83b7\u53d6\u6587\u4ef6\u884c\u6570\uff0c\u6548\u7387\u9ad8\u4e8e ",(0,t.jsx)(n.code,{children:"get_lines"})," \u540e\u518d\u8ba1\u6570\u3002",(0,t.jsx)(n.br,{}),"\n","\u652f\u6301\u5927\u6587\u4ef6\u7edf\u8ba1\u3002"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"\u793a\u4f8b",children:"\u793a\u4f8b"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:'local count, err = LCC.web_file.line_count("/\u65e5\u5fd7/task.log")\nif count then\n    print("\u65e5\u5fd7\u884c\u6570:" .. count)\nend\n'})})]})}function u(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}}}]);