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

Discussion in 'Javascript' started by Cloud Burst, Jan 28, 2004.

  1. Cloud Burst

    Cloud Burst Guest

    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
     
    Cloud Burst, Jan 28, 2004
    #1
    1. Advertising

  2. Cloud Burst

    MikeB Guest

    Look into HTA.
    http://msdn.microsoft.com/workshop/author/hta/overview/htaoverview.asp

    "Cloud Burst" <> wrote in message news:...
    > 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
     
    MikeB, Jan 28, 2004
    #2
    1. Advertising

  3. JRS: In article <>, seen in
    news:comp.lang.javascript, Cloud Burst <> 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.
     
    Dr John Stockton, Jan 28, 2004
    #3
  4. Cloud Burst

    Cloud Burst Guest

    On Wed, 28 Jan 2004 19:49:47 +0000, Dr John Stockton <> wrote:

    >JRS: In article <>, seen in
    >news:comp.lang.javascript, Cloud Burst <> 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.
    >
     
    Cloud Burst, Jan 29, 2004
    #4
  5. Cloud Burst

    Cloud Burst Guest

    On Wed, 28 Jan 2004 13:53:01 -0500, "MikeB" <m.byerleyATVerizonDottieNettie> wrote:

    >Look into HTA.
    >http://msdn.microsoft.com/workshop/author/hta/overview/htaoverview.asp


    Thanks, I will.

    Cheers.

    >"Cloud Burst" <> wrote in message news:...
    >> 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

    >
     
    Cloud Burst, Jan 29, 2004
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jas Shultz
    Replies:
    0
    Views:
    967
    Jas Shultz
    Dec 3, 2003
  2. !George Sgouros
    Replies:
    8
    Views:
    487
    Tor Iver Wilhelmsen
    Dec 23, 2003
  3. Replies:
    2
    Views:
    405
  4. Chris
    Replies:
    5
    Views:
    427
    Randolf Richardson
    Jan 28, 2007
  5. Replies:
    12
    Views:
    529
    santosh
    Nov 15, 2006
Loading...

Share This Page