1 year ago

#348458

test-img

Jigyansu Nanda

getting "Permission denied" while reading from file using custom C++ build in sublime text 4

I use sublime text 4 on macOS. I have a custom C++ build to read from a input.txt file in current file path. but when I run my custom build, it shows

bash: /Users/jigyansu_nanda/Downloads/CP/input.txt: Permission denied

My custom C++ sublime-build is the following.

{
 
 "cmd":["bash", "-c", "g++-11 -Dlocal -std=c++17 -Wall '${file}' -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}'"],
 
 "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
 
 "working_dir": "${file_path}",
 
 "selector": "source.c, source.c++",
 
 "variants":
 
 [
 
   {
 
     "name": "Run",
 
     "cmd":["bash", "-c", "g++-11 -Dlocal -std=c++17 '${file}' -o '${file_path}/${file_base_name}' && bash -c '\"${file_path}/input.txt\" ; read'"]
 
   }
 
 ]
 
}

What can I do to get past this.

c++

sublimetext3

sublimetext4

0 Answers

Your Answer

Accepted video resources