title: A DispatchSource watching for changes in directories is not called when file sizes are updated
body: <p>I wrote a sub-class of UITableViewController that lists the files in a group of directories along with their respective sizes. It also updates itself when there are any changes in those directories. The class uses <code>DispatchSource</code> to "watch" the directories. Here's the code that does that:</p>
  
  <pre><code>    for dir in directories {
          let fd = dir.withUnsafeFileSystemRepresentation { (filenamePointer) -&gt; Int32 in
              // vfw_open is a wrapper function for open()
              return vfw_open(filenamePointer, O_EVTONLY)
          }
  
          guard fd != 0 else {
              return
          }
  
          let watcher = DispatchSource.makeFileSystemObjectSource(fileDescriptor: fd,
                                                                   eventMask: DispatchSource.FileSystemEvent.write,
                                                                   queue: DispatchQueue.global(qos: .utility))
  
          watcher.setEventHandler { [weak self] in
              DispatchQueue.main.async {
                  self?.updateFileList()
              }
          }
  
          watcher.setCancelHandler() {
              close(fd)
          }
  
          watcher.resume()
      }
  </code></pre>
  
  <p>This piece of code basically adds a watcher to each directory and calls <code>updateFileList</code> when changes are observed. It works perfectly and my file list is updated almost instantly with any changes. The problem is, when I copy a large file to a directory, <code>updateFileList</code> is called immediately. So, my controller shows the size of the new file as 0 bytes. But after the file is completely copied, <code>updateFileList</code> is <em>not</em> called and hence the file's actual size is not updated. How can I get the file size to get updated?</p>