Steps to Reproduce
- Installs Windows Remote Desktop client for mac
- Connect to a Windows 10 server, mounting a local folder over the connection
- On the remote server, copy a pdf (e.g.
my_file.pdf
from a remote folder to the mounted Mac folder - Look at the mounted Mac folder locally on the Mac
Observed behavior
The pdf I copied is there.
A second file with the same name plus /Zone.Identifier
is there. (i.e. my_file.pdf/Zone.Identifier
(despite the slash, that's one file name.)
The contents when viewed in a text editor is:
[ZoneTransfer]
ZoneId=3
Issue
One Drive cannot sync files with slashes in their file name, so I get lots of errors whenever I do this, and I have to manually delete each one.
Questions
- What is this file?
- What put it there? Was it the remote desktop client?
- Why doesn't it go away when I close the connection?
- Why doesn't it happen for
.txt
files? - How do I avoid creating such a file?
Best Answer
According to Windows: killing the Zone.Identifier NTFS alternate data stream the Zone.Information is:
ZoneID=3
means it was downloaded from Internet zone (as opposed to Local Intranet etc) . Different zones are detailed in this Microsoft document About URL Security Zones.It is not a function of the file type it is metadata indicating the files provenance.
For example on Windows I created a new file
Doc1.pdf
in Word and downloaded a flight boarding passTest.pdf
from the internet.Only the downloaded file contains a Zone.Identifier stream.
If you then copy these files to mac the stream data is converted to a file but only in the case that there was some. This is because the filesystem (APFS) does not support streams (and indeed Windows doesn't necessarily know what filesystem it is).
Note that if you check with
ls
the name is not FileName.pdf/Zone.Identifier it is FileName.pdf:Zone.Identifier - it is just macOS displays:
as/
in Finder. This is the same name as seen in Windows using PowershellGet-Item -Stream
above or as mentioned in the link as seen using Nirsoft AlternateStreamViewThe contents are whatever were in this NTFS stream. In my case it also contains the website I downloaded it from - the pdf was a flight ticket and has the airline name.
If you are not interested in this information you can remove the ADS on Windows as described in the above link:
Alternatively you can remove them on macOS after copying using
rm
(adjusting the directory)