[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

where is the call to tempfile in the following code?

Chad

9/16/2007 12:58:00 AM

At the following URL
http://groups.google.com/group/comp.lang.ruby/browse_thread......

There is the following code

#!/usr/local/ruby-1.8.0/bin/ruby
require 'ftools'
require 'tempfile'

def compete who, f
5.times do |i|
f.flock File::LOCK_EX
f.puts format("%s:%d @ %f\n",who, i, Time.now.to_f)
f.flock File::LOCK_UN
end
end

path = format(__FILE__ + '.out')
fd = open(path, File::WRONLY | File::TRUNC | File::CREAT)

if fork
compete 'PARENT', fd

Process.wait rescue nil
open(path){|f| puts f.read}
fd.close
File.rm_f path if File.exist? path

else
compete 'CHILD', fd
end

The code runs on my system. But, I don't see any call to Tempfile.new.
I'm assuming it's implied? If it is being implied, where is it being
implied at in the code?
--
Posted via http://www.ruby-....

3 Answers

Marcin Raczkowski

9/16/2007 11:06:00 AM

0

fd = open(path, File::WRONLY | File::TRUNC | File::CREAT)

Michael Linfield

9/17/2007 7:18:00 AM

0

> The code runs on my system. But, I don't see any call to Tempfile.new.
> I'm assuming it's implied? If it is being implied, where is it being
> implied at in the code?

tempfile isnt used as far as my knowledge goes...to test my theory?
delete require 'tempfile' ... if the program still runs fine then ur
gold.
--
Posted via http://www.ruby-....

The Revd

10/21/2011 4:48:00 PM

0

On Fri, 21 Oct 2011 11:55:41 -0400, "Tony Owens"
<owenstony77@university.edu> wrote:

>What stupidity. Had Jesus been the son of God as you claim and had Jews been
>responsible for his death,

He is and they were, Ovens.

"His blood be upon us and upon our children".
- jew witness to crucifixion, 1st century AD

> then God would have smitten every Jew in the
>world (collective guilt as you imply), none would have survived and Israel
>would be non-existent.

God almost did and 'Israel' is just a temporary aberration. It won't
be long before all the jews are pushed into the Mediterranean.

>Instead you believe in lies, superstition and Greek
>mythology. A more ignorant biased dick than you is imaginable. I'd take
>Barabbas over you any time.

While you believe in sucking their fat jew rectums. A more despicable
race traitor than you is hard to imagine.

>
>"The Revd" <peeling@degenerate.Grik> wrote in message
>news:0s43a7p3p3fk60hl966mt18adptchlf5u7@4ax.com...
>> On Fri, 21 Oct 2011 11:36:23 -0400, "Tony Owens"
>> <owenstony77@university.edu> wrote:
>>
>> >Because of his vulgar, obnoxious and scatalogical remarks about the
>Jewish
>> >people, I am quite sure that Heinie regrets the death of "Kid Daffy"
>because
>> >the Tripoli cretin was an enemy of Israel's. However we must keep in mind
>> >what Jehovah, the God of the Jews, told to his Chosen in Genesis:"I will
>> >bless those who blesseth thee and curse those who curseth thee." And so,
>> >chalk up one more piece of shit gone to hell for cursing Jews. Take heed,
>> >Heinie fool.
>>
>> The jews whose rectums you suck were responsible for Christ's death,
>> Ovens. God has been punishing them with purges, pogroms, beatings,
>> persecutions, discriminations, massacres, expulsions, inquisitions,
>> 'holocausts'?? and intifadas ever since.
>