--- In [email protected], "das_e_i" <[EMAIL PROTECTED]> wrote:
>
> I'm writing a script for uploading image files to a FTP-server.
> I use the windows ftp.exe to access the server, having it execute a 
> temporary command file which I create with Powerpro. However, I 
don't 
> seem to be able to open a file for writing (file doesn't exist, 
> should be created). If I manually create the file, it is opened but 
I 
> can't write to it, no error messages then, but no content either.
> Here's the relevant part of the script:
> 
> Local handle=File.Open(strTempDir++"ftpcommands.txt", w)
> if(handle>0) do
>       Win.Debug("Successfully opened"++strTempDir+
> +"ftpcommands.txt")
>       File.WriteLine(handle,"open "++strHostname)
>       File.WriteLine(handle, strUser)
>       File.WriteLine(handle, strPassword)
>       File.WriteLine(handle,"binary")
>       File.WriteLine(handle,"send "++strFile)
>       File.WriteLine(handle,"close")
>       File.WriteLine(handle,"quit")
>       do("ftp", "-s:ftpcommands.txt", strTempDir)
> else
>       Win.Debug("Can't open "++strTempDir++"ftpcommands.txt, handle 
> is" ++ handle)
> endif
> 
> The path is printed correctly in debug window, value of handle when 
> file doesn't exist and I attempt to open it is -2.
> Any ideas?
>

I have now resorted to Exec.ToFile, but I'd still like to know why 
this isn't working...

Reply via email to