AutomateFTP of screen capture

bridged with qnx.gui
Post Reply
AjitG

AutomateFTP of screen capture

Post by AjitG » Thu Jul 26, 2007 3:47 am

Dear Members,
I am working on a system which displays real-time images
grabbed from a line sensor. Each grabbed image is displayed on the
screen using a simple photon application developed by me. Everything
works fine till here.

There is a new feature addition to be done to the above
mentioned system. It is capturing the screen shots of the full
screen photon application and sending the captured image to a FTP
server automatically.
I am using PxWriteImage() function to save the screen-capture
in jpeg format. (Please see
http://www.qnx.com/developers/articles/ ... 293_1.html for more
information)
After the screen-capture file is saved to local hard disk, I want it
to transfer to another machine using FTP.
For this I have written following shell script and I invoke it through
system() command passing the filename as argument 1 ( $1 )

#!/bin/sh
USER=AjitG
PWD=ABC
LOCAL_FOLDER=/root/personal/jpeg/
SERVER=192.152.1.19
ftp -n -i $SERVER <<SCRIPT
user $USER $PWD
bin
lcd $LOCAL_FOLDER
mput $1
bye
SCRIPT


The above design works for few iterations and later the entire system
is stalled.
I have checked with FTP server machine... only few files are
transmitted.

Can you guide me what could be the possible reason for hanging of the
system?

Thanks,
Ajit

Yuriy Synytskyy

Re: AutomateFTP of screen capture

Post by Yuriy Synytskyy » Mon Jul 30, 2007 1:49 pm

Ajit,
1.. I would have checked return code of system()
2.. What exactly happens when all is stalled - I would have run pidin
Yuriy





"AjitG" <ajitgh@goowy-dot-com.no-spam.invalid> wrote in message
news:f895g5$ctg$1@inn.qnx.com...
Dear Members,
I am working on a system which displays real-time images
grabbed from a line sensor. Each grabbed image is displayed on the
screen using a simple photon application developed by me. Everything
works fine till here.

There is a new feature addition to be done to the above
mentioned system. It is capturing the screen shots of the full
screen photon application and sending the captured image to a FTP
server automatically.
I am using PxWriteImage() function to save the screen-capture
in jpeg format. (Please see
http://www.qnx.com/developers/articles/ ... 293_1.html for more
information)
After the screen-capture file is saved to local hard disk, I want it
to transfer to another machine using FTP.
For this I have written following shell script and I invoke it through
system() command passing the filename as argument 1 ( $1 )

#!/bin/sh
USER=AjitG
PWD=ABC
LOCAL_FOLDER=/root/personal/jpeg/
SERVER=192.152.1.19
ftp -n -i $SERVER <<SCRIPT
user $USER $PWD
bin
lcd $LOCAL_FOLDER
mput $1
bye
SCRIPT


The above design works for few iterations and later the entire system
is stalled.
I have checked with FTP server machine... only few files are
transmitted.

Can you guide me what could be the possible reason for hanging of the
system?

Thanks,
Ajit

Post Reply

Return to “qnx.gui”