What's a/the way to read the disk?

C

Cloud Burst

I'm writing a javascript for my own use. I'd like it to read my
disk to get some information. In particular, I want to find out
how much disk is being used by some directories.

At present, I'm pasting the output of a command line "du -s" into
some text fields and using that information.

As I understand it, for security reasons javascript isn't allowed
to do disk input/output. Please correct me if I'm wrong.

So what is the best way to get this type of information off the
disk? In order of preference I'd like an html, javascript, java,
or C solution.

Is there a way to call a script or bat file from html or js? I
doubt it, but thought I'd ask.

Remember, I only want to read the disk, not write to it.

Thanks.

CB
 
D

Dr John Stockton

JRS: In article <[email protected]>, seen in
news:comp.lang.javascript said:
I'm writing a javascript for my own use. I'd like it to read my
disk to get some information. In particular, I want to find out
how much disk is being used by some directories.

At present, I'm pasting the output of a command line "du -s" into
some text fields and using that information.

As I understand it, for security reasons javascript isn't allowed
to do disk input/output. Please correct me if I'm wrong.

Script on Web pages is not allowed access to user's discs.
Script on pages held locally *might* be allowed access.
Script executed at a DOS prompt by CSCRIPT file.JS is allowed access.
Script executed WSCRIPT file.JS is presumably allowed access.
So what is the best way to get this type of information off the
disk? In order of preference I'd like an html, javascript, java,
or C solution.

Increasing or decreasing order?

Pascal, Delphi, ... (decreasing order).


The following work-in-slow-progress reads the short file indicated, when
in a *.js file executed with CSCRIPT on my machine :-


function Get(filename) {
var FSO, ts, char1, char2
WScript.echo("2")
FSO = WScript.CreateObject("Scripting.FileSystemObject")
WScript.echo("3")
ts = FSO.Opentextfile(filename)
WScript.echo("4")
char1 = ts.read(10000)
WScript.echo("5")
// char2 = ts.readline(1)
WScript.echo("6")
ts.close()
WScript.echo("7")
return new String(char1)
}

WScript.echo("AAA")
var St = Get("\\homepage\\mb.htm")
WScript.echo(St)
WScript.echo("ZZZ")


I seek information on "read" methods and similar.
 
C

Cloud Burst

JRS: In article <[email protected]>, seen in


Script on Web pages is not allowed access to user's discs.
Script on pages held locally *might* be allowed access.
Script executed at a DOS prompt by CSCRIPT file.JS is allowed access.
Script executed WSCRIPT file.JS is presumably allowed access.


Increasing or decreasing order?

Decreasing left to right. I'd most prefer an html solution.
Pascal, Delphi, ... (decreasing order).


The following work-in-slow-progress reads the short file indicated, when
in a *.js file executed with CSCRIPT on my machine :-

Works for me, too, after I authorize it via Norton.

I'll see if I can adapt the concept.

Thank you!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top