Results 1 to 15 of 15

Thread: does lscript support relative paths

  1. #1

    does lscript support relative paths

    hello;

    I have an lscript that uses matchdirs(); I am on a winxp;

    currently I can only make it work using:
    matchdirs ( "C:\\a_dir\\sub_dir\\" , "*" ) ;

    I would rather use:
    matchdirs ( "..\\sub_dir\\" , "*" ) ;

    is there some syntax that lscript will permit for relative paths?

    thanks;

  2. #2
    obfuscated SDK hacker Lightwolf's Avatar
    Join Date
    Feb 2003
    Location
    Stuttgart, Germany
    Posts
    13,585
    Quote Originally Posted by dsdsdsdsd View Post
    I would rather use:
    matchdirs ( "..\\sub_dir\\" , "*" ) ;

    is there some syntax that lscript will permit for relative paths?

    thanks;
    Have you tried:
    Code:
    matchdirs ( "sub_dir\\" , "*" ) ;
    That should work on a path relative to the current content directory.

    Cheers,
    Mike

  3. #3
    Mike, thanks for your response;

    I am trying to get to a directory that is above my current directory, so I will need some kind of .. syntax to get me up the directory hierarchy;




    thanks;

  4. #4
    parse or split the content path
    array = parse("//",contentdir)
    array = split(contentdir)
    then just ignore the last item in the array.
    http://walen.se my plugins

  5. #5
    walfridson, thanks for your response;

    I think what you are suggesting is slightly different than what I am working on ... I believe that you are suggesting a string-related function;

    but I am working on a file-management function, specifically using a relative file path within a file-management function;

    thanks though,
    Shannon

  6. #6
    obfuscated SDK hacker Lightwolf's Avatar
    Join Date
    Feb 2003
    Location
    Stuttgart, Germany
    Posts
    13,585
    Quote Originally Posted by dsdsdsdsd View Post
    walfridson, thanks for your response;

    I think what you are suggesting is slightly different than what I am working on ... I believe that you are suggesting a string-related function;

    but I am working on a file-management function, specifically using a relative file path within a file-management function;

    thanks though,
    Shannon
    But you can build an absolute path from that suggestion and then pass that to matchdirs.

    Cheers,
    Mike

  7. #7
    Code:
    	contpar = parse("\\",getdir("Content"));
    	newpath = "";
    	for(i=1;i<contpar.size();i++)
    		newpath += contpar[i] + "\\";
    	info(newpath);
    http://walen.se my plugins

  8. #8
    I suppose that if there exists a value for the getdir( "?" ) function that will return the location of the lscript itself, then I could use it;

    unfortunately getdir("Content") returns the location of my LW installation, as opposed to the location of the lscript that is running;

    I will look through the docs for something;

    thanks,
    Shannon

  9. #9
    SCRIPTID points to the path of the script thats running.

    info(SCRIPTID);
    http://walen.se my plugins

  10. #10
    yes it does ... how did you know about this ... I did not find it in the references: LscriptUserGuide.pdf, LScriptReference.pdf;



    thanks very much to you both,
    Shannon

  11. #11
    Use this, can't remember who created it but the old homepage for it gives 404
    Attached Files Attached Files
    http://walen.se my plugins

  12. #12
    I did find the SCRIPTID in this new document, although it is pretty obscure;

    but more importantly, this implies that Newtek is updating/improving their Lscript documentation, which will be a benefit to LW I believe;

    thanks,
    Shannon

  13. #13
    Valiant NewTeKnight Matt's Avatar
    Join Date
    Feb 2003
    Location
    San Antonio, Texas, USA
    Posts
    13,054
    The ONLY LScript resource you'll ever need!

    http://www.mikegreen.name/Lscript/Lscript%20Index.html

  14. #14
    very nice;

  15. #15
    Super Member Red_Oddity's Avatar
    Join Date
    Feb 2003
    Location
    A thousand years from here
    Posts
    3,352
    Does
    Code:
    matchdirs ( "sub_dir\\.." , "*" ) ;
    work?
    I have no special talents. I am only passionately curious. - Albert Einstein
    visit my company site : House of Secrets
    visit my personal site : svenneve.com

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •