• getcwd() ideas? toDo?

    From Ragnarok@VERT/DOCKSUD to DOVE-Net.Sync_JavaScript on Sunday, February 10, 2008 05:36:00
    Hi
    i think that still is not possible to get the directory of the current
    running script.
    i want to get it to use a relative paths to the script

    something such JS_SCRIPT_NAME?
    in the global object?

    also some ideas:

    using file class:
    var f = new File("/etc/apache2/httpd.conf");
    write (f.get_dir());

    using globals:
    write (file_getdir('/etc/apache2/httpd.conf'))

    will show '/etc/apache2'


    Saludos!
    --
    Dock Sud BBS
    http://bbs.docksud.com.ar
    telnet://bbs.docksud.com.ar

    ---
    þ Synchronet þ Dock Sud BBS TLD 24 HS - http://www.docksud.com.ar - telnet://bbs.docksud.com.ar
  • From Deuce@VERT/SYNCNIX to Ragnarok on Sunday, February 10, 2008 00:53:00
    Re: getcwd() ideas? toDo?
    By: Ragnarok to DOVE-Net.Sync_JavaScript on Sun Feb 10 2008 05:36 am

    i think that still is not possible to get the directory of the current running script.
    i want to get it to use a relative paths to the script

    That's correct, though I am planning on "fixing" that soon-ish. Possible with a cwd variable as with the XJS stuff.

    ---
    Synchronet - Jump on the Web 0.2 bandwagon!

    ---
    þ Synchronet þ My Brand-New BBS (All the cool SysOps run STOCK!)
  • From Angus McLeod@VERT/ANJO to Ragnarok on Sunday, February 10, 2008 09:46:00
    Re: getcwd() ideas? toDo?
    By: Ragnarok to DOVE-Net.Sync_JavaScript on Sun Feb 10 2008 05:36:00

    using file class:
    var f = new File("/etc/apache2/httpd.conf");
    write (f.get_dir());

    using globals:
    write (file_getdir('/etc/apache2/httpd.conf'))

    will show '/etc/apache2'


    Without trailing separator:

    writeln( "/etc/apache2/httpd.conf".replace( /^(.*)\/.*$/, "$1" ) );

    WITH trailing separator:

    writeln( "/etc/apache2/httpd.conf".replace( /^(.*\/).*$/, "$1" ) );

    Enjoy!

    ---
    Playing: "Song for Bob Dylan" by "David Bowie" from the "Hunky dory" album.

    ---
    þ Synchronet þ Making sure Jason works OK at The ANJO BBS