# Access Host file system in OneAgent extension

**URL:** <https://community.dynatrace.com/t/access-host-file-system-in-oneagent-extension/34465>\
**Category:** Extensions\
**Tags:** oneagent, extensions\
**Created:** [March 11, 2022, 2:43pm UTC](https://community.dynatrace.com/t/access-host-file-system-in-oneagent-extension/34465 "2022-03-11T14:43:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![motdde](https://avatars.discourse-cdn.com/v4/letter/m/b3f665/32.png) [@motdde](https://community.dynatrace.com/u/motdde)\
**Post date:** [March 11, 2022, 2:43pm UTC](https://community.dynatrace.com/t/access-host-file-system-in-oneagent-extension/34465/1 "2022-03-11T14:43:40Z")

</div>

How do I access the host file system in OneAgent extension?

I am trying to pass cert and key to a request and I get error 13. I tried tempfile.TemporaryFile() and&nbsp;tempfile.NamedTemporaryFile() they did work either.&nbsp;Bytes not supported and permission denied respectively.

How do I read from a file or pass the file path to request?

---

<div class="post-metadata">

**Author:** ![Mike\_L](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mike_l/32/11717_2.png) [@Mike\_L](https://community.dynatrace.com/u/Mike_L)\
**Post date:** [March 11, 2022, 3:41pm UTC](https://community.dynatrace.com/t/access-host-file-system-in-oneagent-extension/34465/2 "2022-03-11T15:41:55Z")

</div>

The file needs to be readable by the user that executes the extension. For Linux this means dtuser, for Windows this means Local Service.

For temp files we’ve got extensions running on thousands of servers that use:

tempfile.gettempdir()

as the root dir for storing files, and that always worked.

---

<div class="post-metadata">

**Author:** ![motdde](https://avatars.discourse-cdn.com/v4/letter/m/b3f665/32.png) [@motdde](https://community.dynatrace.com/u/motdde)\
**Post date:** [March 11, 2022, 4:59pm UTC](https://community.dynatrace.com/t/access-host-file-system-in-oneagent-extension/34465/3 "2022-03-11T16:59:46Z")

</div>

Thanks&nbsp;[@Mike\_L](https://community.dynatrace.com/user/11520),

I’ll try your suggestions and get back to you.
