I need to use some of the Linux commands in the JavaScript. Is it possible to do that?? If yes what's the syntax for the same??
-
5Are you talking about browser Javascript or something like node.js or rhino. If you mean browser JS then you can't. If you mean node.js you probably can do this.Zachary K– Zachary K2011-03-07 16:47:19 +00:00Commented Mar 7, 2011 at 16:47
-
Please be more specific. You want JS on your pages to access the file systems of your users? That simply is not possible, by design.user50049– user500492011-03-08 12:01:44 +00:00Commented Mar 8, 2011 at 12:01
-
You should definitly find another way to achieve what you need, just because it's like opening your server to the world. At worst you could use ajax calls or SSI or cgi if you need to establish a client-server kind of communication.hornetbzz– hornetbzz2011-03-09 02:11:11 +00:00Commented Mar 9, 2011 at 2:11
Add a comment
|
2 Answers
In Node.js you can spawn child processes (amongst others: run a linux command) with a child_process.
Comments
It's not possible. You can't access the user's (file)system with Javascript because that would be a pretty huge security leak.