Patrick Hurley
7/11/2006 5:55:00 AM
On 7/11/06, Minkoo Seo <minkoo.seo@gmail.com> wrote:
> programs. That being the case, how can I rewrite the following program
> in platform independent way?
>
> print "Hello\r\n"
puts "Hello"
> Dir["/tmp/*"]
# note your code works fine under windows assuming you have a /tmp directory
tmp_path = ENV['TEMP'] || ENV['TMP'] || File.join('','tmp')
Dir[File.join(tmp_path,'*')]
> And I also wonder whether there's another problem related to platform
> independence.
Plenty :-), fork/process handling, services / daemons, drive
letters/mount points, IPC/pipes, etc. It really depends upon your
needs/goals many things are pretty easy, some are very difficult you
need to be more specific.
Good luck
pth