please help!! cp command problem

is there a way to disable all interactive feature in ‘cp’ command? for
example, if there is no enough space in the destination, it pops up a
message ‘out of room, if you wish to continue, please insert another disk
and reply ‘yes’, continue? y/n’. I need to somehow get rid of message, and
if there is no space left
or any other reason cp fails, let cp finish and return.

the reason i need this is because i’m using ‘system (“cp …”)’ in my
program, any interactive message will show up in the shell and haut the
program and the user can’t see the shell…

use popen() instead of system() and handle the message in your code.

In general try to avoid system, it tends to have nasty side effects

Under Neutrino this should never happen; cp is coded to consider all devices
under Neutrino as ‘non-removable’.
cp on QNX 4 only asked this question if the media was removable and standard
input was a tty device. Try redirecting stdin from /dev/null.

“Ran Zhang” <rzhang@vamcointernational.com> wrote in message
news:cq9mf3$7u6$1@inn.qnx.com

is there a way to disable all interactive feature in ‘cp’ command? for
example, if there is no enough space in the destination, it pops up a
message ‘out of room, if you wish to continue, please insert another disk
and reply ‘yes’, continue? y/n’. I need to somehow get rid of message,
and
if there is no space left
or any other reason cp fails, let cp finish and return.

the reason i need this is because i’m using ‘system (“cp …”)’ in my
program, any interactive message will show up in the shell and haut the
program and the user can’t see the shell…