如何确定文件副本是否使用可可完成 [英] How to determine if a file copy is completed using cocoa

查看:140
本文介绍了如何确定文件副本是否使用可可完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Foundation框架和FSEvents API在XCode中开发用于MAC的文件夹观察器应用程序。我需要知道文件是否已经完全复制到目的地之前,我打开文件进行其他操作。有什么方法可以知道吗?请指教

I am developing folder watcher application for MAC in XCode using Foundation framework and FSEvents API. I need to know whether the file has been completely copied to the destination before I open the file for other operation. Is there any way of knowing it? please advice

推荐答案

从简单的学习 FSEvents API 我想说,你想要的是不可能的。我可能会误解,但我从来没有使用FSEvent。 这个问题的提问者已经通过用<$分别监视新文件解决了这个问题c $ c> lsof 。

From simply studying the FSEvents API I would say that what you want is not possible. I could be mistaken, though, I have never used FSEvents myself. The asker of this question has solved the problem by separately monitoring the new file with lsof.

这篇关于如何确定文件副本是否使用可可完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆