SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 7 of 7
  1. #1
    Senior Member
    Join Date
    Jul 1999
    Location
    Columbus, OH, USA
    Posts
    689
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Copy large files?

    Any ideas how to copy large files (40M+) from one location to another?

    If I decide to perform FOpen, FRead, FWrite, and FClose, will I run into data buffer size issues with the FRead/FWrite functions?

    Any other methods?

    Thanks!


    ------------------

  2. #2
    Senior Member
    Join Date
    Jul 2000
    Posts
    186
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Copy large files?

    How about WebFtpGetFile() or WebFtpSendFile()? One of the machines would have to be an FTP server...

    ------------------
    Tom
    Tom

  3. #3
    Senior Member
    Join Date
    Nov 1999
    Posts
    164
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Copy large files?

    You could consider using a Windows API call. For example, the following works for copying file temp.txt from C:\Temp\ to C:\. To copy to another machine you may need to do additional work to authenticate

    dll "kernel32.dll" // func declaration
    "CopyFileA" // copy a file
    function CopyFileA(inout string, inout string, inout boolean): long;

    ...
    transaction TWeb
    var
    sSource, sDest:STRING(20);
    bFailIfExists:BOOLEAN;
    begin
    sSource:="C:\\temp\\temp.txt";
    sDest:="C:\\temp.txt";
    bFailIfExists:=TRUE;
    CopyFileA(sSource,sDest,bFailIfExists);
    end TWeb;


    I don't think that this will allow you to overwrite files.

    ------------------


    [This message has been edited by Stronzo (edited 06-18-2002).]

    [This message has been edited by Stronzo (edited 06-18-2002).]

  4. #4
    Senior Member
    Join Date
    Jul 1999
    Location
    Columbus, OH, USA
    Posts
    689
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Copy large files?

    Thanks, Stronzo! That was a great idea that worked perfectly! I looked up the function on http://vbapi.com to research the parameters and return values a bit more.



    ------------------

  5. #5
    Senior Member
    Join Date
    Jul 2001
    Location
    California, USA
    Posts
    226
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Copy large files?

    Hi,
    I have the following SP code; can somebody tell me why the script is not copying the file from its source to its destination?

    benchmark SilkPerformerRecorder

    use "WebAPI.bdh"
    dll "Kernel32.dll"

    dcluser
    user
    VUser
    transactions
    TInit : begin;
    TWeb : 1;

    var
    sSource, sDest:STRING(20);
    bFailIfExists:BOOLEAN;

    dclrand

    dclfunc
    function FMyFunction1(a : string;
    b : string;
    bool : boolean) : number
    begin
    FMyFunction1;
    end FMyFunction1;

    dcltrans
    transaction TInit
    begin
    WebSetBrowser(WEB_BROWSER_MSIE6);
    end TInit;

    transaction TWeb
    var
    begin

    sSource:="C:\\Import\\blend2.csv";
    sDest:="C:\\blend2.csv";
    bFailIfExists:=TRUE;
    FMyFunction1(sSource,sDest,bFailIfExists);

    end TWeb;


    // ***********************

    [This message has been edited by QA_1 (edited 12-20-2002).]

  6. #6
    Senior Member
    Join Date
    Nov 1999
    Posts
    164
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Copy large files?

    The copy function is from the Windows dll kernel32.dll and SilkPerformer needs to told where to find it. Perhaps the confusion arises from the use of the same function names: in your case you could declare it as follows:

    dll "kernel32.dll" // dll which has func
    "CopyFileA" // function name in dll
    function FMyFunction1(inout string, inout string, inout boolean): long;

    and then call it in the script as you already have done.


    ------------------


    [This message has been edited by Stronzo (edited 12-20-2002).]

  7. #7
    Senior Member
    Join Date
    Jul 2001
    Location
    California, USA
    Posts
    226
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Copy large files?

    Ok, got this to work.

    Thanks.

    [This message has been edited by QA_1 (edited 12-23-2002).]

 

 

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.00%
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 03:37 AM.

Copyright BetaSoft Inc.