[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
insert-file-content on windows and WSL
From: |
samvid mistry |
Subject: |
insert-file-content on windows and WSL |
Date: |
Sat, 20 Jan 2024 12:00:46 +0530 |
Hey,
I was playing with some code and found an unusual behaviour of
insert-file-contents. I am running GNU Emacs 29.1 *on Windows*. When I am
in a file/buffer that is within WSL, accessed using
`//wsl.localhost/Ubuntu/...`, I can open WSL paths without the prefix,
i.e., I can write `(insert-file-contents "/home/samvid/davmail.log")`
instead of `(insert-file-contents
"//wsl.localhost/Ubuntu/home/samvid/davmail.log")` and it will open the
correct file. However, running `(insert-file-contents
"/home/samvid/davmail.log")` when I am in a buffer/file on windows
filesystem, it will run into this error
`(file-missing "Opening input file" "No such file or directory"
"c:/home/samvid/davmail.log")`
I tried looking at the C code implementation but it is completely beyond me
to comprehend. Was wondering if someone can give me a summary on how this
behaviour is implemented and if there is a chance to tweak it somehow to be
able to open WSL paths while being on windows filesystem without the
`//wsl...` prefix.
Thanks,
Samvid
- insert-file-content on windows and WSL,
samvid mistry <=