Reread the node you just responded to. That error message indicates that it probably isn't a permissions error, but that the directory open is trying to create the file in doesn't exist. open with ">" will try to create the file if needed, but
create the directory the file should be in; that has to already exist.