Sublime Forum

Folders showing as linked source when they are not

#1

Build 4113
OS Windows 10

I recently upgraded to ST4, and since then a recurring issue has happened where files are hidden from me if I duplicate a folder in a project. The folder is fully copied and NOT linked.

Example,
Create a folder “A”
Inside it using windows explorer, create a folder “B”
Create a new document inside it “C.txt”
Copy Folder “B” it gets named “B_2”
Inside “B_2” create a new doc “E.txt”

In ST4 “B_2” shows as a linked folder, clicking “reveal linked source” opens folder “B”
There is no way to access file “E.txt”

For clarity I did a quick screen capture:
https://vimeo.com/578804178

This is causing quite a lot of issues!

0 Likes

#2

I can’t reproduce that on my Windows 10 21H1 nor on a fresh VM.

Dragging B while holding ctrl key creates a B - Copy folder which is visible in ST’s sidebar normally. I don’t see something like B_2.

I know about Windows to be able to create hardlinks of files (instead of copying them) in case it realizes them to be the same. This is what seems to happen with your B_2. It might be some kind of hard link as it is equal B. Once renaming B_2 the hardlink is converted to a normal folder.

0 Likes

#3

Thanks for the reply.
That got me investigating further and I have TeraCopy installed which does faster copying of files / folders on windows.
Disabling this, means the files copy and perform in ST4 as expected.

So the question is, what is TeraCopy doing that is causing ST4 (not ST3) to think it’s still a linked resource? As far as I can see a folder copied by explorer is the same as one copied by TeraCopy (same file permissions etc).

Is there some extra “hidden” uuid or something that might be getting duplicated and used as a key?

0 Likes

#4

Offhand and purely from anecdotal evidence it sounds like “faster copying of files” here is a synonym for “create a directory junction” (at least in some cases). Creating a junction/symlink is much faster than copying the file; you just have multiple entries in the file system that all point at the same place.

I’m not sure offhand if there’s a way to see those from the standard properties dialog, but dir /a in a folder containing a junction should tell you if anything in there is linked, so you might want to investigate that (unless you did that already since you mentioned above not seeing anything different).

0 Likes

#5

TeraCopy actually does copy rather than link -

TeraCopy uses dynamically adjusted buffers to reduce seek times.

Unfortunately dir /a doesn’t show anything other than the expected directories and no sign of them being symlinks.

If I edit a file (using say notepad) that is in one of the folders, it does not change the corresponding file in the folder that was copied. I.e. they are two distinct folders and files.

Yet the folder still shows in ST4 as a linked folder with “Reveal Link Source” as an option when I right click.
Thanks for the suggestion though. I can work around this at least now, it’s just a pain not knowing why!

1 Like

#6

Sublime Text uses a fingerprint of a folder to determine if it’s a link of some kind. This is necessary as otherwise hard links (which are completely transparent) would cause infinite recursion into the filesystem. It uses the folder content’s names, sizes, modified time and creation time for the fingerprint. Likely that tool does not update the metadata of any of the files making it look like a hard link.

1 Like

#7

Ah OK - so is there anyway to tell ST4 to refresh / scan again?

If I create a folder structure like:
`
FolderA
–FolderB
----FileC.txt
–FolderD
----FileC.txt
–FolderE
----FileC.txt
----FileF.txt

`
Where folders D & E were duplicated from Folder B.
Then an extra file (F) was created in folder E

At this point if I now open in ST4:
This shows as folder D being a linked resource but not Folder E.

If I now create a new file in Folder D it still shows as a linked resource despite not having the same contents as any other folder. If I could ask ST4 to do a “rescan” that might help a lot.

(Project -> Refresh Folders doesn’t do anything)

0 Likes

#8

Unfortunately once a folder is identified as a link it’s not scanned again on refresh.

0 Likes