copying files to PPC
Hello,

I am trying to copy files on PPC. Now script is able to install the file but it contains only starting field.
Plz help me.

Script :

Function createSettingsFile
;Init RAPI

;----------------------
;Dll Call Structure
;
;HRESULT CeRapiInit(void);
System::Call "rapi::CeRapiInit() i .r0"

;Create the file on the PDA

System::Call "rapi::CeCreateFile(w '\filename.pdb', i 0x80000000|0x40000000, i 0, i 0, i 2, i 0x80, i 0) i .r10"

;Write the data across. Can be done in a loop etc. I think, something should be done here
FileOpen $0 'E:\filename.txt.pdb' r

FileRead $0 $1
Loop:
; loop until we have the index of the last EOF
${IndexOf} $R1 $R0 ""
IntOp $0 $R1 + 1 ;advance index past the slash
StrCpy $R0 $R0 "" $0 ; $R0 now has first segment of path removed
StrCmp $R1 -1 done Next
Next:
IntOp $R2 $R2 + 1 ; add one for the slash
GoTo Loop
done:

;Get the length of the string read
StrLen $2 $1

;----------------------
;Dll Call Structure
;
;BOOL CeWriteFile(
; HANDLE hFile,
; LPCVOID lpBuffer,
; DWORD nNumberOfBytesToWrite,
; LPDWORD lpNumberOfBytesWritten,
; LPOVERLAPPED lpOverlapped
;

System::Call "rapi::CeWriteFile(i r10., t r1, i r2, *i .r3, i 0) i .r11"
;rapi.CeWriteFile(handle, data, len(data), ctypes.byref(written), None)

System::Call "rapi::CeGetLastError() i .r6"

;Close the file on the PDA
System::Call "rapi::CeCloseHandle(i r10) i .r1"

;Close the local file
FileClose $0

System::Free 0

FunctionEnd

Function IndexOf
Exch $R0
Exch
Exch $R1
Push $R2
Push $R3

StrCpy $R3 $R0
StrCpy $R0 -1
IntOp $R0 $R0 + 1
StrCpy $R2 $R3 1 $R0
StrCmp $R2 "" +2
StrCmp $R2 $R1 +2 -3

StrCpy $R0 -1

Pop $R3
Pop $R2
Pop $R1
Exch $R0
FunctionEnd


Where am I going wrong?