Solved

File Operations

Posted on 1998-02-01
10
839 Views
Last Modified: 2008-02-20
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!  :(
0
Comment
Question by:mitchell042997
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 6

Expert Comment

by:Holger101497
ID: 1277911
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
 
LVL 6

Expert Comment

by:Holger101497
ID: 1277912
P.S.: In Internet Explorer, they are possible using JScript's ActiveX entensions.
0
 
LVL 2

Author Comment

by:mitchell042997
ID: 1277913
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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
LVL 6

Expert Comment

by:tecbuilder
ID: 1277914
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
 
LVL 2

Author Comment

by:mitchell042997
ID: 1277915
I do not know live-connect.  What are the function names to perform server-side disk i/o?
0
 
LVL 6

Expert Comment

by:tecbuilder
ID: 1277916
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
 
LVL 2

Author Comment

by:mitchell042997
ID: 1277917
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
 
LVL 6

Expert Comment

by:tecbuilder
ID: 1277918
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
 
LVL 2

Author Comment

by:mitchell042997
ID: 1277919
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
 
LVL 1

Accepted Solution

by:
twexperts earned 10 total points
ID: 1277920
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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question