In HFS+ in MacOS, when a new file is added to a synced folder, fsevents notifies it and the FileAccess::fopen() cannot read it
(yet) until it's fully written to disk (see usage of kMagicBusyCreationDate). Since it's taken as a transient error, a notification is added to the notifyq[RETRY]. However, since the LocalNode doesn't exist, the filename to notify should not include the absolute path to the sync, but only the leaf name. Otherwise, when the notification is processed later in checkpath(), it will build a new name repeating the root of the sync.
Ie. if you have the synced folder A and a new file myfile.bin is copied into that folder, the notification from fsevents is n=myfile.bin (and l=<localnode_of_A_folder>). When the notification to retry is queued, it should be myfile.bin. If we use the localpathNew, which is A/myfile.bin, then the next processing of the notification will result on A//myfile.bin, and next one will be A/A/myfile.bin.
In HFS+ in MacOS, when a new file is added to a synced folder,
fsevents
notifies it and theFileAccess::fopen()
cannot read it (yet) until it's fully written to disk (see usage ofkMagicBusyCreationDate
). Since it's taken as a transient error, a notification is added to thenotifyq[RETRY]
. However, since theLocalNode
doesn't exist, the filename to notify should not include the absolute path to the sync, but only the leaf name. Otherwise, when the notification is processed later incheckpath()
, it will build a new name repeating the root of the sync. Ie. if you have the synced folderA
and a new filemyfile.bin
is copied into that folder, the notification fromfsevents
isn=myfile.bin
(andl=<localnode_of_A_folder>
). When the notification to retry is queued, it should bemyfile.bin
. If we use thelocalpathNew
, which isA/myfile.bin
, then the next processing of the notification will result onA//myfile.bin
, and next one will beA/A/myfile.bin
.