Note that Windows may convert a placeholder file to a regular file when
it is replaced by another file, even if the old and new file (inode,
modified time, file size) are identical.
WIN32_FIND_DATA::dwReserved0 is only initialised in case of
FILE_ATTRIBUTE_REPARSE_POINT is set. This field is not a bit set. Check
corrected to only include all cloud reparse points and not other special
reparse points.
Signed-off-by: Dries Mys <dries.mys@my-dreams.be>
When replacing an OnlineOnly file by another one, the file maintains it
OnlineOnly pin state, but it is converted to a regular file. So, the
dehydration should convert the regular file to a (dehydrated)
placeholder instead of trying to update the (non-existing) placeholder.
Closes#4274
Signed-off-by: Dries Mys <dries.mys@my-dreams.be>
This would only happen if the parent of the newly created folder would
be explicitly set to online only, hence why it went under the radar
previously.
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
This comes with a test simulating an open request coming from another
process (although in our case it's really just a thread). The actual
hydration works as expected by cfapi, handling of encrypted files is for
now missing.
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
Since we often checked the same file states to see if they were virtual,
non virtual or gone, let's factor this out. This way intent in tests is
clearer.
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
This reduces code duplication and opportunities of mistakes between the
test and the implementation.
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
For now this implements only the logic necessary to get a test suite
equivalent to the TestSyncVirtualFiles one to pass. It doesn't (yet)
honor request to fetch files from the system.
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>