I know nothing about
My guess is instead of using
rename-file, you can advice it so that the renaming is done by a
shell-command. This way you use the
rename-file interface, but the implementation is done by the agent who knows a lot about the
9p filesystem (and also
linux file system) It would be good to check if you can use
TRAMP to accomplish what you want. IOW, given a mount point---which appears as
remote, but which is in fact a
localhost connection--- if I move a file from
b within that mount point, will
TRAMP use the command line utilities behind the scense to copy the file. (This sentence could be confusing: For example, I can do
sudo-edit on a local file, with the
TRAMP handling the user permission behind the scenes; in your case, you want the
TRAMP to handle file system difference behind the scenes)
If you are willing to take extra trouble, do a
M-x report-emacs-bug, and a shoot a mail to the developers. Look inside the buffer, for the
To: email address.
I googled a bit, and here are some resources that I found ...
From Editing files in a Windows Subsystem for Linux development environment
Microsoft has recently added comprehensive support for this, and it should be generally available in the April 2019 (19H1) update. Once it's ready, a 9P server will run in the background whenever a Linux distro is running. The 9P server will be able to handle Linux filesystem metadata, and Windows will be able to treat it as a network drive so it can access it safely. You can read about it at https://blogs.msdn.microsoft.com/commandline/2019/02/15/whats-new-for-wsl-in-windows-10-version-1903/.
With the new feature, you'll be able to safely access both Windows and Linux filesystem files from Windows, as long as you go through the 9P server. This will be handled natively from within WSL. For example, from the WSL command line you'll be able to type
code /mnt/c/Users/username/src/windows-file.txt to open a Windows file in VS Code, or type
code /home/username/src/linux-file.txt to open a Linux file in VS Code.
If you're not part of the Windows Insider Program, you won't have access to this yet so you'll still have to use an older method, such as wslpath.
wslpath will convert between Windows- and Linux-style paths so you can easily open Windows files from the WSL command line. As per https://github.com/Microsoft/WSL/issues/3146#issuecomment-388118689, it will refuse to convert Linux filesystem paths (i.e. %AppData%\lxss), because without 9P it's unsafe to modify these files from Windows. This means you can't open
/home/username/src/linux-file.txt, but you can use
code "$(wslpath -aw /mnt/c/Users/username/src/windows-file.txt)".
In the past, there were a number of third-party tools to perform the same conversion but wslpath does it natively-- in fact,
ls -l /bin/wslpath shows that it's just a link to /init.
From What’s new for WSL in Windows 10 version 1903? - Windows Command Line
To put it briefly: a 9P protocol file server facilitates file related requests, with Windows acting as the client.
We've modified the WSL init daemon to initiate a 9P server. This server contains protocols that support Linux metadata, including permissions. A Windows service and driver that act as the client and talks to the 9P server (which is running inside of a WSL instance). Client and server communicate over AF_UNIX sockets, since WSL allows interop between a Windows application and a Linux application using AF_UNIX as described in this post.