2

I have a bunch of files on a (Windows) network mounted location. Many of these files are Windows's symbolic links.

Is there anything I can do to tell Ubuntu to interpet these Windows symlinks appropriately? The pointer in these symlinks are shown below.

l--------- 1 acc acc 0 Dec 18 12:40 file.txt -> /??/D:/path/to/file.txt

Even if I could do something like the below programmatically it would achieve my goal:

if path.contains("/??/D:/") {
    path = path.replace("/??/D:/", "/mnt/share/")
}

I do not want to change the contents of the symbolic links as they're still used by other services on my Windows machine.

edit the reason why I want to do this is because I have an application on Ubuntu that I'm pointing to the symlinks on the (Windows) network share but they aren't finding the target file successfully due to sym links being of different structure in Linux compared to Windows. The target file is within the same share and permissions aren't the issue.

1 Answer 1

4

Assuming the ?? in the symlink target are literally ??, you could easily give the symlinks what they are asking for. Namely, just create a directory named /??/D: with sudo mkdir -p '/??/D:' (don't forget the single quotes to keep ? and : from being interpreted as special characters). Then do sudo mount -o bind /mnt/share '/??/D:' to make the contents of /mnt/share accessible also at /??/D:.

If this does what you want, you can make it permanent by adding this line to /etc/fstab:

/mnt/share /??/D: auto bind 0 0
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .