Page 1 of 1

Receiving External PRN file from Server

Posted: February 6th, 2018, 6:17 pm
by Yass
Hi Forum,

I have this line to bring a file from a server to my program folder for it to be use as a loadcase

...

Code: Select all

syncfile(GET, "/Drink/Supoort/CohortDrink.csdb", "CohortDrink.csdb");
The idea is to be updating the "CohortDrink.csdb" file from the server.

The sync works well but i can't see my file from the server coming into my folder "Support.

Re: Receiving External PRN file from Server

Posted: February 8th, 2018, 4:29 pm
by aaronw
What type of sync are you performing (Bluetooth, Dropbox, FTP, CSWeb)?

In the meantime you can accomplish the same thing by using syncdata. You will need to delete the CSDB file on the client and then call GET.
function ForceFullSync()

    if syncconnect(Bluetooth) then

        // Deleting the CSDB on the client will force a full GET sync
        close(SIMPLECAPI_DICT);
        filedelete("./Simple CAPI Data.csdb");
        setfile(SIMPLECAPI_DICT, "./Simple CAPI Data.csdb", create);

        if not syncdata(GET, SIMPLECAPI_DICT) then
            errmsg("Failed to sync SIMPLECAPI_DICT");
        endif;

        if not syncdisconnect() then
            errmsg("Failed to disconnect");
        endif;

    else
        errmsg("Failed to connect");

    endif;

end;