problem in putting the file into the right folder by bluetoo
Posted: October 7th, 2015, 1:13 pm
Hi,
I am doing some testing on transferring files through bluetooth. But I found that i cannot control which folder I want to copy to on server device through client device.
According to the help, the following codes should work.
{Send RSI information file to another interviewer (on interviewer device) }
function SendRSIinfoIntv ( OthIntvCode, alpha(20) OthIntvName )
setfile( PNCfile, concat( strip(DirUtility), "SendRSIinfoIntv", ".pnc" ));
FileDelete( PNCfile );
FileWrite( PNCfile, "[SyncFile]" );
FileWrite( PNCfile, "Version=CSPro 6.1" );
FileWrite( PNCfile, "AppName=SendRSIinfoIntv" );
FileWrite( PNCfile, "Description=Send RSI information file to another interviewer" );
FileWrite( PNCfile, concat( "RootFolder=", strip(DirWrkprj) ));
FileWrite( PNCfile, concat( "DeviceName=", concat( edit("999",ThisDeviceCode), " (", strip(ThisIntvName), ")" ) ));
FileWrite( PNCfile, " " );
FileWrite( PNCfile, "[Connection]" );
FileWrite( PNCfile, "Type=Bluetooth" );
FileWrite( PNCfile, concat( "ServerDeviceName=", concat( edit("999", OthIntvCode), " (", strip(OthIntvName), ")" ) ));
FileWrite( PNCfile, " " );
FileWrite( PNCfile, "[Sync]" );
FileWrite( PNCfile, "ClientPath=/Ref/" );
FileWrite( PNCfile, concat( "Put=RSMinfo", edit("999",ThisDeviceCode), ".dat" ));
FileWrite( PNCfile, "ServerPath=/Ref/" );
close( PNCfile );
// Close the external dictionary file so that it can be read by the synchronization script
close( DEVICE );
close( SAMPLEHH );
close( RSIINFO );
close( TUNIS2015HH_DICT );
close( TUNIS2015RSI_DICT );
if sync( filename(PNCfile) ) = 1 then
errmsg( 006, strip(OthIntvName), OthIntvCode );
endif;
end;
{Receive reference files from interviewer (on interviewer device) }
function RecvRSIinfoIntv ()
setfile( PNCfile, concat( strip(DirUtility), "RecvRSIinfoIntv", ".pnc" ));
FileDelete( PNCfile );
FileWrite( PNCfile, "[SyncFile]" );
FileWrite( PNCfile, "Version=CSPro 6.1" );
FileWrite( PNCfile, "AppName=RecvRSIinfoIntv" );
FileWrite( PNCfile, "Description=Receive RSI information file from anther interviewer" );
FileWrite( PNCfile, concat( "RootFolder=", strip(DirWrkprj) ));
FileWrite( PNCfile, concat( "DeviceName=", concat( edit("999",ThisDeviceCode), " (", strip(ThisIntvName), ")" ) ));
FileWrite( PNCfile, " " );
FileWrite( PNCfile, "[Connection]" );
FileWrite( PNCfile, "Type=BluetoothServer" );
close( PNCfile );
if sync( filename(PNCfile) ) = 1 then
errmsg( 007 );
endif;
end;
But it does not, I can only copy the file to the folder defined by DirWrkprj.
While the following works, if I define the receiving folder on the server device part.
{Send RSI information file to another interviewer (on interviewer device) }
function SendRSIinfoIntv ( OthIntvCode, alpha(20) OthIntvName )
setfile( PNCfile, concat( strip(DirUtility), "SendRSIinfoIntv", ".pnc" ));
FileDelete( PNCfile );
FileWrite( PNCfile, "[SyncFile]" );
FileWrite( PNCfile, "Version=CSPro 6.1" );
FileWrite( PNCfile, "AppName=SendRSIinfoIntv" );
FileWrite( PNCfile, "Description=Send RSI information file to another interviewer" );
FileWrite( PNCfile, concat( "RootFolder=", strip(DirWrkprj) ));
FileWrite( PNCfile, concat( "DeviceName=", concat( edit("999",ThisDeviceCode), " (", strip(ThisIntvName), ")" ) ));
FileWrite( PNCfile, " " );
FileWrite( PNCfile, "[Connection]" );
FileWrite( PNCfile, "Type=Bluetooth" );
FileWrite( PNCfile, concat( "ServerDeviceName=", concat( edit("999", OthIntvCode), " (", strip(OthIntvName), ")" ) ));
FileWrite( PNCfile, " " );
FileWrite( PNCfile, "[Sync]" );
FileWrite( PNCfile, "ClientPath=/Ref/" );
FileWrite( PNCfile, concat( "Put=RSMinfo", edit("999",ThisDeviceCode), ".dat" ));
close( PNCfile );
// Close the external dictionary file so that it can be read by the synchronization script
close( DEVICE );
close( SAMPLEHH );
close( RSIINFO );
close( TUNIS2015HH_DICT );
close( TUNIS2015RSI_DICT );
if sync( filename(PNCfile) ) = 1 then
errmsg( 006, strip(OthIntvName), OthIntvCode );
endif;
end;
{Receive reference files from interviewer (on interviewer device) }
function RecvRSIinfoIntv ()
setfile( PNCfile, concat( strip(DirUtility), "RecvRSIinfoIntv", ".pnc" ));
FileDelete( PNCfile );
FileWrite( PNCfile, "[SyncFile]" );
FileWrite( PNCfile, "Version=CSPro 6.1" );
FileWrite( PNCfile, "AppName=RecvRSIinfoIntv" );
FileWrite( PNCfile, "Description=Receive RSI information file from anther interviewer" );
FileWrite( PNCfile, concat( "RootFolder=", strip(DirRef) ));
FileWrite( PNCfile, concat( "DeviceName=", concat( edit("999",ThisDeviceCode), " (", strip(ThisIntvName), ")" ) ));
FileWrite( PNCfile, " " );
FileWrite( PNCfile, "[Connection]" );
FileWrite( PNCfile, "Type=BluetoothServer" );
close( PNCfile );
if sync( filename(PNCfile) ) = 1 then
errmsg( 007 );
endif;
end;
The only different between the two is that the first one tryes to define the receiving folder on the client device part, while the second one tryes to define the receiving folder on the server device, part.
FYI,
DirWrkprj = "/storage/emulated/0/csentry/";
DirRef = concat( strip(DirWrkprj), "Ref/" );
Did i misundertood anything?
best
Jing
I am doing some testing on transferring files through bluetooth. But I found that i cannot control which folder I want to copy to on server device through client device.
According to the help, the following codes should work.
{Send RSI information file to another interviewer (on interviewer device) }
function SendRSIinfoIntv ( OthIntvCode, alpha(20) OthIntvName )
setfile( PNCfile, concat( strip(DirUtility), "SendRSIinfoIntv", ".pnc" ));
FileDelete( PNCfile );
FileWrite( PNCfile, "[SyncFile]" );
FileWrite( PNCfile, "Version=CSPro 6.1" );
FileWrite( PNCfile, "AppName=SendRSIinfoIntv" );
FileWrite( PNCfile, "Description=Send RSI information file to another interviewer" );
FileWrite( PNCfile, concat( "RootFolder=", strip(DirWrkprj) ));
FileWrite( PNCfile, concat( "DeviceName=", concat( edit("999",ThisDeviceCode), " (", strip(ThisIntvName), ")" ) ));
FileWrite( PNCfile, " " );
FileWrite( PNCfile, "[Connection]" );
FileWrite( PNCfile, "Type=Bluetooth" );
FileWrite( PNCfile, concat( "ServerDeviceName=", concat( edit("999", OthIntvCode), " (", strip(OthIntvName), ")" ) ));
FileWrite( PNCfile, " " );
FileWrite( PNCfile, "[Sync]" );
FileWrite( PNCfile, "ClientPath=/Ref/" );
FileWrite( PNCfile, concat( "Put=RSMinfo", edit("999",ThisDeviceCode), ".dat" ));
FileWrite( PNCfile, "ServerPath=/Ref/" );
close( PNCfile );
// Close the external dictionary file so that it can be read by the synchronization script
close( DEVICE );
close( SAMPLEHH );
close( RSIINFO );
close( TUNIS2015HH_DICT );
close( TUNIS2015RSI_DICT );
if sync( filename(PNCfile) ) = 1 then
errmsg( 006, strip(OthIntvName), OthIntvCode );
endif;
end;
{Receive reference files from interviewer (on interviewer device) }
function RecvRSIinfoIntv ()
setfile( PNCfile, concat( strip(DirUtility), "RecvRSIinfoIntv", ".pnc" ));
FileDelete( PNCfile );
FileWrite( PNCfile, "[SyncFile]" );
FileWrite( PNCfile, "Version=CSPro 6.1" );
FileWrite( PNCfile, "AppName=RecvRSIinfoIntv" );
FileWrite( PNCfile, "Description=Receive RSI information file from anther interviewer" );
FileWrite( PNCfile, concat( "RootFolder=", strip(DirWrkprj) ));
FileWrite( PNCfile, concat( "DeviceName=", concat( edit("999",ThisDeviceCode), " (", strip(ThisIntvName), ")" ) ));
FileWrite( PNCfile, " " );
FileWrite( PNCfile, "[Connection]" );
FileWrite( PNCfile, "Type=BluetoothServer" );
close( PNCfile );
if sync( filename(PNCfile) ) = 1 then
errmsg( 007 );
endif;
end;
But it does not, I can only copy the file to the folder defined by DirWrkprj.
While the following works, if I define the receiving folder on the server device part.
{Send RSI information file to another interviewer (on interviewer device) }
function SendRSIinfoIntv ( OthIntvCode, alpha(20) OthIntvName )
setfile( PNCfile, concat( strip(DirUtility), "SendRSIinfoIntv", ".pnc" ));
FileDelete( PNCfile );
FileWrite( PNCfile, "[SyncFile]" );
FileWrite( PNCfile, "Version=CSPro 6.1" );
FileWrite( PNCfile, "AppName=SendRSIinfoIntv" );
FileWrite( PNCfile, "Description=Send RSI information file to another interviewer" );
FileWrite( PNCfile, concat( "RootFolder=", strip(DirWrkprj) ));
FileWrite( PNCfile, concat( "DeviceName=", concat( edit("999",ThisDeviceCode), " (", strip(ThisIntvName), ")" ) ));
FileWrite( PNCfile, " " );
FileWrite( PNCfile, "[Connection]" );
FileWrite( PNCfile, "Type=Bluetooth" );
FileWrite( PNCfile, concat( "ServerDeviceName=", concat( edit("999", OthIntvCode), " (", strip(OthIntvName), ")" ) ));
FileWrite( PNCfile, " " );
FileWrite( PNCfile, "[Sync]" );
FileWrite( PNCfile, "ClientPath=/Ref/" );
FileWrite( PNCfile, concat( "Put=RSMinfo", edit("999",ThisDeviceCode), ".dat" ));
close( PNCfile );
// Close the external dictionary file so that it can be read by the synchronization script
close( DEVICE );
close( SAMPLEHH );
close( RSIINFO );
close( TUNIS2015HH_DICT );
close( TUNIS2015RSI_DICT );
if sync( filename(PNCfile) ) = 1 then
errmsg( 006, strip(OthIntvName), OthIntvCode );
endif;
end;
{Receive reference files from interviewer (on interviewer device) }
function RecvRSIinfoIntv ()
setfile( PNCfile, concat( strip(DirUtility), "RecvRSIinfoIntv", ".pnc" ));
FileDelete( PNCfile );
FileWrite( PNCfile, "[SyncFile]" );
FileWrite( PNCfile, "Version=CSPro 6.1" );
FileWrite( PNCfile, "AppName=RecvRSIinfoIntv" );
FileWrite( PNCfile, "Description=Receive RSI information file from anther interviewer" );
FileWrite( PNCfile, concat( "RootFolder=", strip(DirRef) ));
FileWrite( PNCfile, concat( "DeviceName=", concat( edit("999",ThisDeviceCode), " (", strip(ThisIntvName), ")" ) ));
FileWrite( PNCfile, " " );
FileWrite( PNCfile, "[Connection]" );
FileWrite( PNCfile, "Type=BluetoothServer" );
close( PNCfile );
if sync( filename(PNCfile) ) = 1 then
errmsg( 007 );
endif;
end;
The only different between the two is that the first one tryes to define the receiving folder on the client device part, while the second one tryes to define the receiving folder on the server device, part.
FYI,
DirWrkprj = "/storage/emulated/0/csentry/";
DirRef = concat( strip(DirWrkprj), "Ref/" );
Did i misundertood anything?
best
Jing