LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-10-2012, 03:28 PM   #1
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
JavaScript write access to files


AFAIK, write access directly from JavaScript is impossible, and it is this way for security reasons.

It looks like there is a possibility to perform write access using Java: http://www.javascripter.net/faq/writinga.htm#top .

I've been thinking of a possibly using JavaScript as a general purpose scripting language - like Perl/Python/Ruby. I think JavaScript libraries are actively being developed, so the language can become convenient for general purpose tasks.

So, my question is: has anybody developed an extension at source level for an FOSS JavaScript implementation (I guess Firefox/Mozilla JavaScript is such an implementation) ?

I.e. if to along this way one will have to have a locally compiled such JavaScript interpreter with file write access.
 
Old 01-10-2012, 04:02 PM   #2
Telengard
Member
 
Registered: Apr 2007
Location: USA
Distribution: Kubuntu 8.04
Posts: 579
Blog Entries: 8

Rep: Reputation: 148Reputation: 148
Mozilla has something for geneal purpose development outside the browser.

I think there is also ECMA-script for Java.

Sorry I can't recall specifics ATM.

edit
see if one of these matches your interest

http://en.wikipedia.org/wiki/JavaScr...side_web_pages

https://developer.mozilla.org/en/SpiderMonkey

http://en.wikipedia.org/wiki/List_of_JVM_languages

https://developer.mozilla.org/en/Rhino

Last edited by Telengard; 01-10-2012 at 04:17 PM.
 
Old 01-10-2012, 04:42 PM   #3
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Original Poster
Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by Telengard View Post
Mozilla has something for geneal purpose development outside the browser.

I think there is also ECMA-script for Java.

Sorry I can't recall specifics ATM.

edit
see if one of these matches your interest

http://en.wikipedia.org/wiki/JavaScr...side_web_pages

https://developer.mozilla.org/en/SpiderMonkey

http://en.wikipedia.org/wiki/List_of_JVM_languages

https://developer.mozilla.org/en/Rhino
Thanks.

I think only https://developer.mozilla.org/en/SpiderMonkey matches my interest as a source for which a file writer plugin is needed.

I don't think Java itself has anything to do with what I'm interested in - I'd like not to use Java; the FAQ I gave is just an example how file write access can be implemented using a Java applet, and I want just a small extension to an existing JavaScript interpreter source.
 
Old 01-10-2012, 05:04 PM   #4
Telengard
Member
 
Registered: Apr 2007
Location: USA
Distribution: Kubuntu 8.04
Posts: 579
Blog Entries: 8

Rep: Reputation: 148Reputation: 148
I guess I really don't know what you mean by file writer plugin, but that's okay.

Quote:
Originally Posted by Sergei Steshenko View Post
I don't think Java itself has anything to do with what I'm interested in - I'd like not to use Java
I think the idea of Rhino is to write Javascript programs to be executed in a Java Virtual Machine.

Anyway, I hope you find something which works for your purposes.
 
Old 01-10-2012, 07:51 PM   #5
lyle_s
Member
 
Registered: Jul 2003
Distribution: Slackware
Posts: 392

Rep: Reputation: 55
Quote:
Originally Posted by Sergei Steshenko View Post
I've been thinking of a possibly using JavaScript as a general purpose scripting language - like Perl/Python/Ruby.
I think you can do this with nodejs (nodejs.org).

Lyle.
 
Old 01-11-2012, 01:14 PM   #6
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Original Poster
Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by lyle_s View Post
I think you can do this with nodejs (nodejs.org).

Lyle.
I didn't read everything, but I read http://nodejs.org/about/ . I don't quite see how writing to files can be achieved.
 
Old 01-11-2012, 01:15 PM   #7
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Original Poster
Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by Telengard;...4571357
I guess I really don't know what you mean by file writer plugin, but that's okay.
...
"Plugin" maybe a bad term in this case. I mean a piece of code to be added to JavaScript interpreter that would add a write to file feature to the language.
 
Old 01-11-2012, 01:33 PM   #8
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,781

Rep: Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082
Quote:
Originally Posted by Sergei Steshenko View Post
I didn't read everything, but I read http://nodejs.org/about/ . I don't quite see how writing to files can be achieved.
Looks like there is filesystem access: http://nodejs.org/docs/latest/api/fs.html
 
1 members found this post helpful.
Old 01-11-2012, 01:47 PM   #9
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Original Poster
Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by ntubski View Post
Looks like there is filesystem access: http://nodejs.org/docs/latest/api/fs.html
Yep, thanks.

And examples are even with my favorite anonymous functions.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Group write access for newly created files/directories without changing umask fhd Linux - Security 3 04-05-2009 05:28 AM
javascript write/read cookie sir-lancealot Programming 1 02-07-2009 06:33 AM
Listing all write access files on command line akamad Linux - General 6 03-14-2007 11:37 AM
Having read/write access to some files in windows NTFS partition rahilrai Linux - Newbie 7 12-17-2005 01:02 PM
How to gain **write-access** to windows xp files? sairam9 Linux - Newbie 3 07-14-2005 09:09 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration