File Operations

Is it possible to do file operations in JavaScript?  (i.e. open a text file, write a line, delete a line, etc.)?  Sorry for the low points, but it's ALL that I have!  :(
LVL 2
mitchell042997Asked:
Who is Participating?
 
twexpertsConnect With a Mentor Commented:
Take a look at this site, it tells you everything you will need to know about server side JS.

http://developer.netscape.com/library/documentation/enterprise/wrijsap/index.htm

So to answer your question, Yes, you can do disk acess on the server side, but also no, you can't do it without adding in the JavaScript runtime engine to your server.

The JavaScript itself is compiled into bytecode executables, similar to the Java Language techniques, the engine then runs these executables when requested....

Sorry that it isn't what you wanted, if you have access to perl/cgi, I'm sure you could do anything you need with that, and you probably won't need to have anything installed server side, as most ISP's include these interpreters/compilers.

Robin (twexperts)
0
 
Holger101497Commented:
well, I post a comment instead of an answer so you can save your points for other questions...
No, file operations are not possible in Javacript. Period. It's a security feature and probably better that way (it can only be done with signed scripts in Netscape 4). File manipulations are a suicidal feature for users of Internet Exploder. Personally, I would never allow any remote computer on the internet to modify anything on my hard disk (why not modify autoexec.bat to include the very handy "format c: /u <y.key" (where y.key contains a "y" (for "YES! Do destroy my computer!") and a carriage return)??!)
0
 
Holger101497Commented:
P.S.: In Internet Explorer, they are possible using JScript's ActiveX entensions.
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
mitchell042997Author Commented:
I guess my question wasn't very clear.  Is it possible to do server side file i/o with JavaScript?  Or can you do anything server side with JavaScript?  I am using InterDev, and I know that VBScript can write to the server, but I am wanting to be able to do that with JavaScript.  Is this possible, or is it still a no go?
0
 
tecbuilderCommented:
Holger, welcome back.

mitchell, yes server-side javascript aka Live-Connect can open, close, read, and write files.  

BTW, almost every question that is here relates to client-side javascript and is what tends to be assumed if server-side javascript is not mentioned within the question.  There are many people who do not have access to the server which will ask the same type of question as you did to find out the limits of clien-side javascript.
0
 
mitchell042997Author Commented:
I do not know live-connect.  What are the function names to perform server-side disk i/o?
0
 
tecbuilderCommented:
You first have to obtain the compiler and what ever else comes with Live-Connect aka server-side javascript from Netscape before you can use it I believe.  I don't work with server-side JavaScript, but I have investigated a few questions to learn about some of the things it can do.  And of course, I cannot find the place which told me the file I/O commands.  I've looked everywhere but the right place.
0
 
mitchell042997Author Commented:
Just trash this question.  Forget it.

Thanks for your answers, guys, but I was just looking for an answer that said I could do it without having to append anything on to my system...  I guess I just assumed that one could do file i/o like they trap events, flag events, etc. in JavaScript.  Sorry for the waste of time!
0
 
tecbuilderCommented:
Sorry, but that is not how experts-exchange works.  I really don't mean to be rude, but I did answer your question and it is unfair that because you can't do what you want that you should just have it deleted.  I answered your question and should receive the points.
0
 
mitchell042997Author Commented:
I forsee an interesting moral debate arising.  I agree, I should not be allowed to trash my question.  Therefore I am not trashing it.  However, let me ask you this?  What if the answer you have received, you believe to be incorrect?  Who is to say that your answer is the correct one?  I am reopening the question, to allow others to answer, if there is indeed a different answer to be had.  Giving points to an incorrect answer is not how Experts Exchange works.  Therefore, although your answer may very well be correct, I leave it open for now, hoping a different answer to my problem will be presented.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.