The command is executed with the same use running apache.<div>So if apache&#39;s user doesn&#39;t have the rights to access/read/write to the files, then your command neither.</div><div><br></div><div>You can try to &quot;su apache_user&quot; and try this command.</div>

<div>It&#39;s the same problem as not being able to move the files directly with the mono API.<br><br><div class="gmail_quote">On Wed, May 18, 2011 at 12:54 PM, <a href="mailto:harmeet.singh@onebcg.com">harmeet.singh@onebcg.com</a> <span dir="ltr">&lt;<a href="mailto:harmeet.singh@onebcg.com">harmeet.singh@onebcg.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

  
    
  
  <div bgcolor="#ffffff" text="#000000">
    <font face="Tahoma">Hi<br>
      <br>
      Finally it works. Thanks<br>
      <br>
      Still having one problem. It works for physical path. But when we
      are trying to copy files to folder (mounted with amazon S3) it
      gives error. Log file shows permission denied error. <br>
      <br>
      Copy works while executing command from command line but doesn&#39;t
      run when executing from application. May be Apache/Mono server
      running application doesn&#39;t have full permissions.<br>
      <br>
      Any Suggestion.<br>
      <br>
      Thanks again for your help.<br>
      <br>
    </font><div class="im">
    <div>
      <div style="margin:0px;padding:0px;width:100%;float:left;color:rgb(51, 51, 51);font-size:12px">
        Regards,<br>
        <br>
        Harmeet Singh<br>
        <div style="margin:0px;padding:0px;width:100%;float:left;color:rgb(102, 102, 102);font-size:11px">Software Engineer
          .NET<br>
          <div style="margin:0px;padding:0px;width:100%;float:left;color:rgb(51, 51, 51);font-size:11px">Ext: 3023<br>
            <br>
          </div>
          <div style="margin:0px;padding:0px;width:100%;float:left;color:rgb(102, 102, 102);font-size:11px">Phone AU:
            <a href="tel:%2B61%202%209114%206001" value="+61291146001" target="_blank">+61 2 9114 6001</a>    |    IN: <a href="tel:%2B91%20172%20424%208888" value="+911724248888" target="_blank">+91 172 424 8888</a>    |    UK: +44
            2070 99 88 50    |    US: <a href="tel:%2B1%20866%20420%209555" value="+18664209555" target="_blank">+1 866 420 9555</a><br>
          </div>
          <div style="margin:0px;padding:0px;width:100%;float:left;color:rgb(102, 102, 102);font-size:11px">Fax<span style="padding:0pt 0pt 0pt 16px">AU: +61 2 9114
              6002    |    IN: <a href="tel:%2B91%20172%20424%208889" value="+911724248889" target="_blank">+91 172 424 8889</a>    |    UK: +44 2070 99
              49 55    |    US: <a href="tel:%2B1%20480%20304%203080" value="+14803043080" target="_blank">+1 480 304 3080</a></span><br>
          </div>
          <div style="margin:0px;padding:5px;width:100%;float:left;color:rgb(102, 102, 102);font-size:11px"><a href="http://www.onebcg.com" target="_blank"><img alt="ONE BCG" border="0" height="50" width="100"></a></div>


          <div style="margin:0px;padding:0px;width:100%;float:left;color:rgb(111, 111, 111);font-size:10px">This
            message is for the designated recipient only and may contain
            privileged, proprietary, or otherwise private information.
            If you have received it in error, please notify the sender
            immediately and delete the original. Any other use of the
            email by you is prohibited.</div>
          <div style="margin:2px;padding:0px;width:100%;float:left;color:rgb(0, 128, 0);font-size:10px">Please
            consider the environment before printing this email<br>
            <br>
            <br>
          </div>
        </div>
      </div>
    </div>
    <br></div><div><div></div><div class="h5">
    On 5/18/2011 2:06 PM, nekresh wrote:
    <blockquote type="cite">
      <div class="gmail_quote">Standard non-error exit code on linux is
        0</div>
      <div class="gmail_quote">If you get something else then an error
        as occured.</div>
      <div class="gmail_quote"><br>
      </div>
      <div class="gmail_quote">Are you sure that both path exists ?</div>
      <div class="gmail_quote">Do you have read/write rights ?</div>
      <div class="gmail_quote"><br>
      </div>
      <div class="gmail_quote">On Wed, May 18, 2011 at 10:22 AM, <a href="mailto:harmeet.singh@onebcg.com" target="_blank">harmeet.singh@onebcg.com</a>
        <span dir="ltr">&lt;<a href="mailto:harmeet.singh@onebcg.com" target="_blank">harmeet.singh@onebcg.com</a>&gt;</span>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
          <div bgcolor="#ffffff" text="#000000"> <font face="Tahoma">Hi<br>
              <br>
              I tried the code. My code is <br>
              <br>
              protected void Button1_Click(object sender, EventArgs e)<br>
                  {       <br>
                      Label1.Text=Execute(&quot;/bin/cp&quot;,&quot; -rp
              /usr/local/lib/xsp/test/2.0/projectname/invoices/
              /usr/local/lib/xsp/test/2.0/projectname/testupload/&quot;).ToString();
              <div><br>
                    }<br>
                    internal int Execute(string exe, string args)<br>
                    {<br>
                        ProcessStartInfo oInfo = new
                ProcessStartInfo(exe, args);<br>
                        oInfo.UseShellExecute = false;<br>
                        oInfo.CreateNoWindow = true;<br>
                <br>
                        oInfo.RedirectStandardOutput = true;<br>
                        oInfo.RedirectStandardError = true;<br>
                <br>
                       <br>
                <br>
              </div>
              <div>         Process proc =
                System.Diagnostics.Process.Start(oInfo);<br>
                        proc.WaitForExit();       <br>
              </div>
              <div>         int exitCode = proc.ExitCode;<br>
                        proc.Close();<br>
                <br>
                        return exitCode;<br>
                    }<br>
                <br>
                <br>
              </div>
              Output returned is 1. But Files are not copied to
              destination folder. Any suggestions.<br>
              <br>
            </font>
            <div>
              <div style="margin:0px;padding:0px;width:100%;float:left;color:rgb(51, 51, 51);font-size:12px">
                Regards,<br>
                <br>
                Harmeet Singh<br>
                <div style="margin:0px;padding:0px;width:100%;float:left;color:rgb(102, 102, 102);font-size:11px">Software Engineer .NET<br>
                  <div style="margin:0px;padding:0px;width:100%;float:left;color:rgb(51, 51, 51);font-size:11px">Ext: 3023<br>
                    <br>
                  </div>
                  <div style="margin:0px;padding:0px;width:100%;float:left;color:rgb(102, 102, 102);font-size:11px">Phone AU: <a href="tel:%2B61%202%209114%206001" value="+61291146001" target="_blank">+61 2 9114
                      6001</a>    |    IN: <a href="tel:%2B91%20172%20424%208888" value="+911724248888" target="_blank">+91 172 424
                      8888</a>    |    UK: <a href="tel:%2B44%202070%2099%2088%2050" value="+442070998850" target="_blank">+44 2070 99 88 50</a>    |    US:
                    <a href="tel:%2B1%20866%20420%209555" value="+18664209555" target="_blank">+1 866 420
                      9555</a><br>
                  </div>
                  <div style="margin:0px;padding:0px;width:100%;float:left;color:rgb(102, 102, 102);font-size:11px">Fax<span style="padding:0pt 0pt 0pt 16px">AU:
                      <a href="tel:%2B61%202%209114%206002" value="+61291146002" target="_blank">+61 2 9114 6002</a>    |    IN: <a href="tel:%2B91%20172%20424%208889" value="+911724248889" target="_blank">+91 172
                        424 8889</a>    |    UK: +44 2070 99 49
                      55    |    US: <a href="tel:%2B1%20480%20304%203080" value="+14803043080" target="_blank">+1 480 304
                        3080</a></span><br>
                  </div>
                  <div style="margin:0px;padding:5px;width:100%;float:left;color:rgb(102, 102, 102);font-size:11px"><a href="http://www.onebcg.com" target="_blank"><img alt="ONE BCG" border="0" height="50" width="100"></a></div>


                  <div style="margin:0px;padding:0px;width:100%;float:left;color:rgb(111, 111, 111);font-size:10px">This message is for the designated recipient
                    only and may contain privileged, proprietary, or
                    otherwise private information. If you have received
                    it in error, please notify the sender immediately
                    and delete the original. Any other use of the email
                    by you is prohibited.</div>
                  <div style="margin:2px;padding:0px;width:100%;float:left;color:rgb(0, 128, 0);font-size:10px">Please consider the environment before
                    printing this email<br>
                    <br>
                    <br>
                  </div>
                </div>
              </div>
            </div>
            <div>
              <div> <br>
                On 5/17/2011 4:04 PM, nekresh wrote: </div>
            </div>
            <blockquote type="cite">
              <div>
                <div>
                  <pre>On Tue, May 17, 2011 at 12:03 PM, harmeets <a href="mailto:harmeet.singh@onebcg.com" target="_blank">&lt;harmeet.singh@onebcg.com&gt;</a> wrote:
</pre>
                  <blockquote type="cite">
                    <pre>Hi what will be exe and args here?
</pre>
                  </blockquote>
                </div>
              </div>
              <pre><div><div>
With your command : /bin/cp -rp
/usr/local/lib/xsp/test/2.0/projectname/invoices/
/usr/local/lib/xsp/test/2.0/projectname/testupload/

The exe part will be &quot;/bin/cp&quot;
and the args part will be &quot;-rp
/usr/local/lib/xsp/test/2.0/projectname/invoices/
/usr/local/lib/xsp/test/2.0/</div></div>projectname/testupload/&quot;
_______________________________________________
Mono-devel-list mailing list
<div><a href="mailto:Mono-devel-list@lists.ximian.com" target="_blank">Mono-devel-list@lists.ximian.com</a>
<a href="http://lists.ximian.com/mailman/listinfo/mono-devel-list" target="_blank">http://lists.ximian.com/mailman/listinfo/mono-devel-list</a>

</div></pre>
            </blockquote>
          </div>
        </blockquote>
      </div>
      <br>
      <pre><fieldset></fieldset>
_______________________________________________
Mono-devel-list mailing list
<a href="mailto:Mono-devel-list@lists.ximian.com" target="_blank">Mono-devel-list@lists.ximian.com</a>
<a href="http://lists.ximian.com/mailman/listinfo/mono-devel-list" target="_blank">http://lists.ximian.com/mailman/listinfo/mono-devel-list</a>
</pre>
    </blockquote>
  </div></div></div>

</blockquote></div><br></div>