<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
I wanted to thank you guys for you help with this and other problems I posted recently. <BR>
My project entered beta today... and I'm expecting it to be opensourced in the coming mth or so.<BR>
 <BR>
I ended up using the suggestion of using the fpsystem() call which seemed to work well except that it does not work if you do not have a bash shell installed in your environment. I worked around this by sym linking sh to bash to make it work under busybox; however, someone may want to look to see if the fpsystem call can be shell independant.<BR>
 <BR>
John<BR> <BR>
<HR id=stopSpelling>
From: zittware@hotmail.com<BR>To: fpc-pascal@lists.freepascal.org<BR>Subject: Exec(), Linux, and /dev/null redirection<BR>Date: Tue, 16 Feb 2010 16:34:08 -0800<BR><BR>
<STYLE>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Verdana;}
</STYLE>
I'm cross developing a program in free pascal running FreeVision. When running under Linux / Busybox; I'm attempting to mount a device to scan it for a set of files. Since I'm running a TUI (Text User Interface); I cannot have the BusyBox mount command printing failure information to the screen where it corrupts the TUI. The pascal code:<BR> <BR>Exec( '/bin/mount', '/dev/'+ aline +' /media/' + aline + ' &> /dev/null');<BR> <BR>When running:<BR> <BR>Exec( '/bin/mount', '/dev/'+ aline +' /media/' + aline );<BR> <BR>I see "device busy" STDERR messages appear on the screen. However, when I try to redirect using the ' &> /dev/null' it appears as tho the BusyBox executable is being passed ' &> /dev/null' as a parameter and isn't taking it as the appropriate redirection command.<BR> <BR>I tried the following kludge instead:<BR>var<BR>OurPipe    : Text;<BR> <BR>         popen( OurPipe, '/bin/mount /dev/'+ aline +' /media/' + aline, 'R');<BR>         Try<BR>             if (fpgeterrno=0) then Flush (OurPipe)<BR>             ELSE MessageBox ('mount pipe error ' + IntToStr(fpgeterrno), nil,<BR>                  mfError or mfOKButton);<BR>         Finally<BR>             PClose( OurPipe );<BR>         END;<BR> <BR>however, I'm getting an Accessviolation. unsure if I'm even going down the right path.<BR> <BR>Any other suggestions?<BR>                                        </body>
</html>