Results 1 to 2 of 2
  1. #1

    How to find a file exists in a mentioned location?

    Hi all,

    I'm working on Winrunner 7.6 and i have a query regarding finding a file in the mentioned location.

    I have gone through previous posts

    if (file_exists("C:\\TEST") == 0)
    print "file or path exists";
    print "file or path does NOT exist";
    but for this function we need cso extensions.

    Is there any other way to find the file?
    Our client has not provided the cso extension files

    Kindly help me out.

    Thanks in advance


  2. #2

    Re: How to find a file exists in a mentioned location?

    WR 7.6? That still works? wow

    a few ideas come to mind:

    1 - you can attempt to use the file_open command and see if it returns an error, if it doesn't then follow up with a file_close. If it produces an error, then the file isn't present

    2 - link into the WinAPI call for file exists and call it directly

    3 - use dos_command to use the dir with a /b switch and pipe it into a text file, then parse the contents of the text file, if it contains "File Not Found", then you know your answer.
    Insanity: doing the same thing over and over again and expecting different results



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 07:21 PM.

Copyright BetaSoft Inc.