473,385 Members | 2,005 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

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
Jul 20 '05 #1
4 1924
Look into HTA.
http://msdn.microsoft.com/workshop/a...taoverview.asp

"Cloud Burst" <su*@shine.com> wrote in message news:5h********************************@4ax.com...
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

Jul 20 '05 #2
JRS: In article <5h********************************@4ax.com>, seen in
news:comp.lang.javascript, Cloud Burst <su*@shine.com> 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.
Jul 20 '05 #3
On Wed, 28 Jan 2004 19:49:47 +0000, Dr John Stockton <sp**@merlyn.demon.co.uk> wrote:
JRS: In article <5h********************************@4ax.com>, seen in
news:comp.lang.javascript, Cloud Burst <su*@shine.com> 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.


Jul 20 '05 #4
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" <su*@shine.com> wrote in message news:5h********************************@4ax.com...
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


Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: lkrubner | last post by:
Are there any benchmarks on how much an extra, unneeded VARCHAR, CHAR, INT, BIGINT, TEXT or MEDIUMTEXT slows down a database call with MySql? PostGre info would also be useful. I'm trying to...
0
by: Peter Hitchmough | last post by:
What is the *truth* when it comes to configuring Oracle files on an Enterprise Virtual Array like an HP EVA3000 or EVA5000 or an EMC Symmetrix frame. As I Understand It - A Virtual Array is a...
2
by: Jim Richards | last post by:
I have been told by a local PC club technician that 98SE cannot read NTFS drives in a network. Is this true? TIA, Jim.
13
by: Relaxin | last post by:
I'm just trying to figure out the terminology that is used on this board and wanted to know what is WAL and what roll does it play in Postgresql? Thanks
1
by: Shrirang Ballal | last post by:
I am doing a project which requires to read the raw bytes from hard disk. It rrequires to access the partition table and then the individual partitions. I want some material related to these...
17
by: Luc Mercier | last post by:
Hi Folks, I'm new here, and I need some advice for what tool to use. I'm using XML for benchmarking purposes. I'm writing some scientific programs which I want to analyze. My program generates...
1
by: Praveen | last post by:
I want to read individual disk label for Hard disk (C: drive, D: drive disk label) and CD-ROM disk label Please provide some pointer to the code or document. Thanks in advance.
9
by: Nebojsa4 | last post by:
Hi. First, sorry on my weak English to all. Qusetion: How to read (in VB) Manufacturer serial number of Hard disk drive? Not volume/serial number of C:, D:, etc. partitons. For reading...
14
by: chance | last post by:
Hello, I have a file on disk called TEMP.ZIP and I would like to somehow get this into a memory stream so I can eventually do this: row = dataStream.ToArray() However, I am not sure of the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.