MCPcopy Index your code
hub / github.com/ZToolsCenter/ZTools / checkFilePaths

Method checkFilePaths

src/main/api/renderer/system.ts:242–271  ·  view source on GitHub ↗
(
    paths: string[]
  )

Source from the content-addressed store, hash-verified

240 }
241
242 private async checkFilePaths(
243 paths: string[]
244 ): Promise<Array<{ path: string; isDirectory: boolean; exists: boolean }>> {
245 try {
246 const results = await Promise.all(
247 paths.map(async (filePath) => {
248 try {
249 const stats = await fs.stat(filePath)
250 const result = {
251 path: filePath,
252 isDirectory: stats.isDirectory(),
253 exists: true
254 }
255 return result
256 } catch (error) {
257 console.log('[System] 主进程:文件不存在或无权访问:', filePath, error)
258 return {
259 path: filePath,
260 isDirectory: false,
261 exists: false
262 }
263 }
264 })
265 )
266 return results
267 } catch (error) {
268 console.error('[System] 主进程:检查文件路径失败:', error)
269 return []
270 }
271 }
272}
273
274export default new SystemAPI()

Callers 1

setupIPCMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected