SPONSORS:






User Tag List

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

Thread: file_copy

  1. #1
    Senior Member
    Join Date
    Oct 2003
    Posts
    129
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    file_copy

    Is there any file_copy function in WinRunner. IF not is there any way where we can write a user defined function to copy a particular file from one folder to another?

    Thanks

  2. #2
    Moderator
    Join Date
    Mar 2000
    Location
    Orange County, CA
    Posts
    3,187
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: file_copy

    you can also look into the win32API calls and wrapper the file copy API to eliminate the need for a dos box.

    Doesn't take much work to create that WIN32API function
    Insanity: doing the same thing over and over again and expecting different results

  3. #3
    Senior Member
    Join Date
    Oct 2003
    Posts
    129
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: file_copy

    How to create that.... i Actually want to avoid command Prompt. Please help

    Thanks

  4. #4
    Senior Member
    Join Date
    May 2001
    Location
    Ankh-Morpork
    Posts
    2,882
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: file_copy

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">dos_system(&quot;copy c:\\folder1\\file1 c:\\folder2\\file1&quot;</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">If you feel the need to make a function, I would simply do something like:
    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">public function copy_file(in file1, in file2)
    {
    auto rc;
    dos_system(sprintf(&quot;copy /Y %s %s&quot;, file1, file2));
    rc = file_open(file2, FO_MODE_READ);
    if(rc == E_OK)
    file_close(file2);
    return(rc);
    }</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">
    web site | [url=http://www.ebookworm.us/[/url]

    [i]...Sound trumpets! Every trumpet in the host! / Sixty thousand, on these words, sound, so high the mountains sound, and the valleys resound.&lt;/i] (The Song of Roland)

  5. #5
    Moderator
    Join Date
    Mar 2000
    Location
    Orange County, CA
    Posts
    3,187
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: file_copy

    You can find the information on the Win32API by searching on the web, or by getting a hold of a book reference for the Win32 API.

    You can then read through the WR manuals and learn how to interface with the external dlls that are present in WinRunner.


    If you are looking for it to be done for you (as it seems), then you might want to go check out the Mercury CSO site and look into the CSO libraries they provide.
    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
  •  
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 10.71%
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 06:03 AM.

Copyright BetaSoft Inc.