• getcwd() ideas? toDo?

    From Deuce@VERT to Ragnarok on Sun Feb 10 00:53:00 2008
    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 to Ragnarok on Sun Feb 10 09:46:00 2008
    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