> > import Foundation
> > import Foundation
> >
> > func clearTemporaryFiles() {
> > let fileManager = FileManager.default
> > let tempDir = NSTemporaryDirectory()
> >
> > do {
> > let files = try fileManager.contentsOfDirectory(atPath: tempDir)
> > for file in files {
> > let filePath = (tempDir as NSString).appendingPathComponent(file)
> > try fileManager.removeItem(atPath: filePath)
> > print("Deleted: \(filePath)")
> > }
> > } catch {
> > print("Error clearing temp files: \(error)")
> > }
> > }
>
>
_Originally posted by @teerawad020841 in https://github.com/teerawad020841/cr/issues/1#issuecomment-4598205566_
关闭于 2026-06-02 0 条评论