File path access denied

Hi There,

I’m trying to serialize a JSON file to a specific file path on my PC

I seem to get in error about the path and I can’t figure out what the problem is.

the error is:
Runtime error (IOException): Access to the path “…” is denied

I am using a trial version of Rhino 7
Windows 10 PC
Capture

Since you didn’t provide a way of repeating the runtime error, you might consider two possibilities:

1.) You don’t have user right to write a file to that location
2.) The file you are trying to write (or overwrite ) is open by something

– Dale

I also tried to create the path automatically to avoid errors with the script below

import os

HERE = os.path.dirname(file)
FILE_O = os.path.join(HERE, ‘test.json’)

but for this, i get the error as shown in the image

solved this error in grasshopper with the script below

import Grasshopper as gh
import os

gh_path = ghdoc.Path
file = os.path.dirname(os.path.realpath(gh_path))