On Tue, Sep 23, 2008 at 1:57 AM, Milo Thurston
<[EMAIL PROTECTED]> wrote:
>
> Bill Walton wrote;
>> When you say 'fails' I assume you mean you just can't find the file you
>> expect to be created anywhere on your system.
>
> That's part of it. I tried setting things up as in this pseudocode:
>
> begin
>  logger.info("ONE")
>  first system call
>  logger.info("TWO")
>  second system call
>  logger.info("THREE")
> rescue
>  redirect to the error page
> end
>
> In this case the expected file does not appear, "ONE" is found in the
> log but not "TWO" or "THREE", and the app. redirects to the error page.
> It seems that the system call is a complete failure with no explanation.
>
>> When you say 'on the command line', do you mean from irb or
>> script\console ?
>> Or do you mean 'from the OS command line'?  If the latter, it's
>> potentially
>> a permissions issue.
>
> I tried it on the OS command line. I thought that it might be
> permissions, but I'd run script/server as a user that has write
> permission to the relevant directory. I'd also expect some sort of
> permissions error in the logs from the system call but none were to be
> found. I hadn't tried it with irb or script/console but I just did and
> it worked as expected. Very odd...
>
> Thanks for taking the time to make some suggestions!
>

Rather than using system() you can use backticks `echo "hello"` to
capture output of a command, which will tell you more about, what
happened to the call.

Also, in rails system() or `` backticks are only not advised, when
they end up blocking the master mongrel process for a real long time,
otherwise you can happily use system() or `` within your programs
without problems.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to