Detect disk activity in Delphi

前端 未结 4 645
闹比i
闹比i 2020-12-28 23:49

I\'m using Delphi 2007.

I am copying files to a remote drive. When the copying ends, I shutdown/standby the machine. It can happen that some files don\'t get copied

4条回答
  •  难免孤独
    2020-12-29 00:41

    It depends on the type of disk activity you want to detect.

    The language "Delphi" in-and-of itself probably has no libraries to help you with this.

    • Using Win32 API calls you can Obtain Directory Change Notifications.
    • In .NET you can use a FileSystemWatcher to monitor directories.

    If those don't do it for you then you need to drop down to hooking the operating system calls or more likely the hardware level which usually involves writing a device driver hooking the IDT (Interrupt Descriptor Table). I recommend the book Rootkits for more information.

提交回复
热议问题