LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Recieving a blank file during ftp session (https://www.linuxquestions.org/questions/programming-9/recieving-a-blank-file-during-ftp-session-340658/)

mrobertson 07-06-2005 12:54 PM

Recieving a blank file during ftp session
 
I have the following ftp command coded and saved as c:\ftp.cmd:

Code:

open pl7cam3
root
pass
cd etc
put camdata

I am trying to ftp a file from windows to a network camera's hardrive (etc directory). The file that I am trying to send is camdata which resides in the c:\ directory of windows. Camdata is populated by a vb6 program. The code above will execute the transfering of the file, but sends a blank file. When I try to open the file from the camera it is blank, yet when I open it from windows it is populated. Does anyone see what the problem may be here?

deiussum 07-06-2005 12:58 PM

Just a thought, but maybe your current local directory is not c:\ when it is executed. Have you tried replacing the put with something like:

put c:\camdata camdata

mrobertson 07-06-2005 01:19 PM

That did the trick! Thank you very much for you help.

mrobertson 07-06-2005 01:26 PM

Maybe you could answer one last question for me. I have a script running that will read and print out this file that I am ftp 'ing. Right now I am using the following code:

Code:

#!/bin/sh
while sleep 1
      do
            cat camdata
done

And this code will print it out each time over and over again taking up multiple lines. The file is four lines of text. Is there anyway to just print the 4 lines and then when it comes time to print again....just print over the previous four lines so that there is always only 4 lines of text printed instead of 4 then 8 then 12 then 16.....etc?

deiussum 07-06-2005 01:31 PM

Hmmm... The easiest way might be just to add a clear before the cat.

Code:

#!/bin/sh
while sleep 1
      do
            clear
            cat camdata
done

Obviously that will clear the whole screen each time.

If that isn't what you want, I think there are some apps you can use from the shell script to position the cursor in your terminal, but I don't know what they are called offhand.


All times are GMT -5. The time now is 02:40 PM.