# How to specify a full Windows path in Eio?

**URL:** <https://discuss.ocaml.org/t/how-to-specify-a-full-windows-path-in-eio/14880>\
**Category:** Learning\
**Tags:** eio\
**Created:** [June 29, 2024, 3:31pm UTC](https://discuss.ocaml.org/t/how-to-specify-a-full-windows-path-in-eio/14880 "2024-06-29T15:31:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![darrenldl](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/darrenldl/32/291_2.png) [@darrenldl](https://discuss.ocaml.org/u/darrenldl)\
**Post date:** [June 29, 2024, 3:31pm UTC](https://discuss.ocaml.org/t/how-to-specify-a-full-windows-path-in-eio/14880/1 "2024-06-29T15:31:45Z")

</div>

Hi all,

I am confused about the use of `Eio.Path` on Windows:

I am trying to handle a path, say, `C:\path\file.txt`. I initially tried to write it as `Eio.Path.(fs / "C:\\path\\file.txt")`, which did not work.

Then I noticed from Eio 1.1 documentation that “In Eio, the directory separator is always “/”, even on Windows.”, but I have tried the following options to put in `Eio.Path.(fs / ...)` to no success:

- `C:/path/file.txt`
- `c:/path/file.txt`
- `/C:/path/file.txt`
- `/c:/path/file.txt`
- `/C/path/file.txt`
- `/c/path/file.txt`
- `C/path/file.txt`
- `c/path/file.txt`

I’m lost on what I’m missing here.

Cheers,  
Darren

---

<div class="post-metadata">

**Author:** ![talex5](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/talex5/32/353_2.png) [@talex5](https://discuss.ocaml.org/u/talex5)\
**Post date:** [June 29, 2024, 4:26pm UTC](https://discuss.ocaml.org/t/how-to-specify-a-full-windows-path-in-eio/14880/2 "2024-06-29T16:26:35Z")

</div>

Good question!

`(fst fs, "C:/path/file.txt")` should do, as a work-around.

I think we need a proper way to import native paths from the user.

`/C:/path/file.txt` makes sense to me as a generic form of an absolute Windows path, but I don’t think `eio_windows` accepts it currently. I’ve added a note at [Windows support · Issue #125 · ocaml-multicore/eio · GitHub](https://github.com/ocaml-multicore/eio/issues/125) - more input from Windows users would be very helpful!

---

<div class="post-metadata">

**Author:** ![darrenldl](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/darrenldl/32/291_2.png) [@darrenldl](https://discuss.ocaml.org/u/darrenldl)\
**Post date:** [June 30, 2024, 2:46am UTC](https://discuss.ocaml.org/t/how-to-specify-a-full-windows-path-in-eio/14880/3 "2024-06-30T02:46:59Z")

</div>

Thanks for the reply!

That doesn’t seem to work though, I still get a `Unix.ENOENT` error.

---

<div class="post-metadata">

**Author:** ![dra27](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/dra27/32/5294_2.png) [@dra27](https://discuss.ocaml.org/u/dra27)\
**Post date:** [July 1, 2024, 8:17am UTC](https://discuss.ocaml.org/t/how-to-specify-a-full-windows-path-in-eio/14880/4 "2024-07-01T08:17:27Z")

</div>

I must confess that introducing yet another notation for a Windows path doesn’t look at all sensible to me! `/C:/path` is simply invalid, and if that’s ever printed (error messages, exceptions, etc.) it kinda just looks like Eio doesn’t know what it’s doing.
