SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3

Thread: File Path

  1. #1
    Junior Member
    Join Date
    Apr 2005
    Posts
    17
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    File Path

    When I tried to read ini file by its filename only, which is located at the same level directory as current project folder, the file cannot be found. Of course, once the full path is given, it works~~, Can I read the file by the filename instread of the full path?


    Many Thanks [img]images/icons/smile.gif[/img]
    April

  2. #2
    Senior Member
    Join Date
    Oct 2004
    Location
    Las Vegas
    Posts
    473
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: File Path

    Hi,

    When you are using the file name without the path, all file-routines search this file in the current directory. By default the current directory for an application is the directory of its executable file. However, current directory is not fixed - it may change during the execution of the application (some function calls change the current directory).

    So, please use the full path to access a file from script.

    If the file is always in the directory of your TestComplete project, you can use this script to get its full path:

    [JScript]
    var CfgFileName = "MyFile.ini"
    var FullPath = Options.Project.Directory + CfgFileName;

    Atanas

  3. #3
    Junior Member
    Join Date
    Apr 2005
    Posts
    17
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: File Path

    so many thanks to Atanas~

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 11:17 AM.

Copyright BetaSoft Inc.