# How to create an \`Eio.Path\` by hand for testing?

**URL:** <https://discuss.ocaml.org/t/how-to-create-an-eio-path-by-hand-for-testing/16739>\
**Category:** Learning\
**Tags:** eio\
**Created:** [May 31, 2025, 1:23pm UTC](https://discuss.ocaml.org/t/how-to-create-an-eio-path-by-hand-for-testing/16739 "2025-05-31T13:23:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nikochiko](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/nikochiko/32/4741_2.png) [@nikochiko](https://discuss.ocaml.org/u/nikochiko)\
**Post date:** [May 31, 2025, 1:23pm UTC](https://discuss.ocaml.org/t/how-to-create-an-eio-path-by-hand-for-testing/16739/1 "2025-05-31T13:23:57Z")

</div>

One of the functions in my library takes an argument of type `[`Dir] Eio.Path.t`. I want to be able to test this. I am struggling to come up with a way to craft this type by hand from a string.  
I could not find an alternative in `Eio_mock` or a way to handcraft a path in `Eio.Path` or `Eio.Fs`.

---

<div class="post-metadata">

**Author:** ![yawaramin](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/yawaramin/32/3384_2.png) [@yawaramin](https://discuss.ocaml.org/u/yawaramin)\
**Post date:** [May 31, 2025, 3:34pm UTC](https://discuss.ocaml.org/t/how-to-create-an-eio-path-by-hand-for-testing/16739/2 "2025-05-31T15:34:52Z")

</div>

`Eio.Stdenv.fs env / the_string`

?

---

<div class="post-metadata">

**Author:** ![nikochiko](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/nikochiko/32/4741_2.png) [@nikochiko](https://discuss.ocaml.org/u/nikochiko)\
**Post date:** [May 31, 2025, 4:34pm UTC](https://discuss.ocaml.org/t/how-to-create-an-eio-path-by-hand-for-testing/16739/3 "2025-05-31T16:34:55Z")

</div>

Ah, that’s what `fs` meant in the documentation. Thanks! I kept trying to work with `Eio.Fs` instead.
