Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 7503

Python • opening autofs nfs mount

$
0
0
I've got a Python program that opens a jpeg file from a nfs mount, but that is mounted when required by using autofs.

Code:

#!/usr/bin/env python3from datetime import datetimewith open('/nfs/weather/webcam.jpg', 'rb') as f:    photo = f.read()
Except that it doesn't seem to be mounting that file when required.

I've even tried using this to see if that will work, but it still isn't mounting that file.

Code:

import ospath = "/nfs/weather/"dir_list = os.listdir(path)print(dir_list)
If I use ls it works:

Code:

ls /nfs/weather/webcam  webcam.jpg
I was using fstab to mount the nfs share, but I kept getting

Code:

nfs: server 192.168.2.167 not responding, timed out

Statistics: Posted by mfraz74 — Sun Feb 01, 2026 10:12 am — Replies 1 — Views 32



Viewing all articles
Browse latest Browse all 7503

Trending Articles