# What is path format on Linux systems for system.file.readFileAsBytes?

**URL:** <https://forum.inductiveautomation.com/t/what-is-path-format-on-linux-systems-for-system-file-readfileasbytes/63058>\
**Category:** Ignition\
**Created:** [August 16, 2022, 4:30pm UTC](https://forum.inductiveautomation.com/t/what-is-path-format-on-linux-systems-for-system-file-readfileasbytes/63058 "2022-08-16T16:30:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![framebuilder](https://avatars.discourse-cdn.com/v4/letter/f/96bed5/32.png) [@framebuilder](https://forum.inductiveautomation.com/u/framebuilder)\
**Post date:** [August 16, 2022, 4:30pm UTC](https://forum.inductiveautomation.com/t/what-is-path-format-on-linux-systems-for-system-file-readfileasbytes/63058/1 "2022-08-16T16:30:20Z")

</div>

Trying to read a cifs file (mounted) on the gateway on an Ubuntu system Ignition 8.1.18 via system.file.readFileAsBytes but don’t know the format of the path or maybe I don’t know what the path is relative to on Linux.

I know how to do it on Windows.  
Here’s the script:

```auto
path = '/mnt/share/test.jpg'
bytes = system.file.readFileAsBytes(path)
print len(bytes)

```

but keeps saying it doesn’t exist or isn’t a file.  
I’ve tried:

```auto
//mnt//share//test.jpg
//mnt/share//test.jpg
\mnt\share\test.jpg

```

I realize it could be permissions issue but I can’t really find any debugging to point me in that direction and the files/folder have 777 permissions (for testing).

Any ideas?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 16, 2022, 4:34pm UTC](https://forum.inductiveautomation.com/t/what-is-path-format-on-linux-systems-for-system-file-readfileasbytes/63058/2 "2022-08-16T16:34:50Z")

</div>

Your original format was correct. The path probably doesn’t exist or isn’t correct or it’s a permissions problem.

Get a terminal on the server and verify the path. Make sure you’re executing the code in gateway scope.

---

<div class="post-metadata">

**Author:** ![framebuilder](https://avatars.discourse-cdn.com/v4/letter/f/96bed5/32.png) [@framebuilder](https://forum.inductiveautomation.com/u/framebuilder)\
**Post date:** [August 16, 2022, 4:52pm UTC](https://forum.inductiveautomation.com/t/what-is-path-format-on-linux-systems-for-system-file-readfileasbytes/63058/3 "2022-08-16T16:52:04Z")

</div>

Yep, scope got me again. I was running in Designer. I threw it in a Gateway timer script and all is fine.

Curious what other people use to test “Gateway scope” scripts…surely there’s something better than a gateway timer script. Note that I have Edge with Compute. So no Vision. Ideas?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 16, 2022, 4:54pm UTC](https://forum.inductiveautomation.com/t/what-is-path-format-on-linux-systems-for-system-file-readfileasbytes/63058/4 "2022-08-16T16:54:09Z")

</div>

I usually just make a boolean tag with a tag change event script on it, and then toggle it.

---

<div class="post-metadata">

**Author:** ![framebuilder](https://avatars.discourse-cdn.com/v4/letter/f/96bed5/32.png) [@framebuilder](https://forum.inductiveautomation.com/u/framebuilder)\
**Post date:** [August 16, 2022, 5:26pm UTC](https://forum.inductiveautomation.com/t/what-is-path-format-on-linux-systems-for-system-file-readfileasbytes/63058/5 "2022-08-16T17:26:19Z")

</div>

Good suggestion. Thanks @Kevin.Herron

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 16, 2022, 9:29pm UTC](https://forum.inductiveautomation.com/t/what-is-path-format-on-linux-systems-for-system-file-readfileasbytes/63058/6 "2022-08-16T21:29:21Z")

</div>

I usually make a gateway message handler and call it with `system.util.sendRequest()`. You can use that in a designer script console.
