vico
vico

Reputation: 18171

Editing startup script from java

I have startup script in my Linux machine /etc/init.d/myscr. Need to add some lines in it from inside of java application.

I do very simple file write routines, but have exception

java.io.FileNotFoundException: \etc\init.d\myscr (No such file or directory)

Looks like java doesn't sees my file. Why?

Upvotes: 0

Views: 104

Answers (1)

Amila
Amila

Reputation: 5213

You should use File.separator when constructing the file path. Also make sure you have permission to write to the file.

Upvotes: 1

Related Questions