Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > What's a/the way to read the disk?

Reply
Thread Tools

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

 
 
Cloud Burst
Guest
Posts: n/a
 
      01-28-2004
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
 
Reply With Quote
 
 
 
 
MikeB
Guest
Posts: n/a
 
      01-28-2004
Look into HTA.
http://msdn.microsoft.com/workshop/a...taoverview.asp

"Cloud Burst" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
 
Dr John Stockton
Guest
Posts: n/a
 
      01-28-2004
JRS: In article <(E-Mail Removed)>, seen in
news:comp.lang.javascript, Cloud Burst <(E-Mail Removed)> posted at Wed, 28
Jan 2004 17:32:06 :-
>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.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk DOS 3.3, 6.20; Win98. ©
Web <URL:http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms & links.
PAS EXE TXT ZIP via <URL:http://www.merlyn.demon.co.uk/programs/00index.htm>
My DOS <URL:http://www.merlyn.demon.co.uk/batfiles.htm> - also batprogs.htm.
 
Reply With Quote
 
Cloud Burst
Guest
Posts: n/a
 
      01-29-2004
On Wed, 28 Jan 2004 19:49:47 +0000, Dr John Stockton <(E-Mail Removed)> wrote:

>JRS: In article <(E-Mail Removed)>, seen in
>news:comp.lang.javascript, Cloud Burst <(E-Mail Removed)> posted at Wed, 28
>Jan 2004 17:32:06 :-
>>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?


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!

>
>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.
>


 
Reply With Quote
 
Cloud Burst
Guest
Posts: n/a
 
      01-29-2004
On Wed, 28 Jan 2004 13:53:01 -0500, "MikeB" <m.byerleyATVerizonDottieNettie> wrote:

>Look into HTA.
>http://msdn.microsoft.com/workshop/a...taoverview.asp


Thanks, I will.

Cheers.

>"Cloud Burst" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
>> 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

>


 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
way way way OT: MCNGP Announcement Neil MCSE 174 04-17-2006 05:55 PM
Help: Program to read from EOR end of last read? snoopy_@excite.com Java 3 04-07-2006 12:32 PM
AMD Opteron: 1-way, 2-way, ... Up to 8-way. John John Windows 64bit 12 12-27-2005 08:17 AM
Binary data stored in SQL Server: can't read from ASP.NET, *can* read from Access? Doug ASP .Net 3 11-04-2005 07:35 PM
Re: How to change Read Only Constraint to Read-Write Isaac VHDL 0 07-10-2003 01:43 PM



Advertisments