Hey guys i got a probleme with this code :
out = `ls`
puts out
When i run it i got :
C:/Users/Xcoder/Documents/NetBeansProjects/Learnerr/lib/Sys.rb:1:in ``':
No such
file or directory - ls (Errno::ENOENT)
from
C:/Users/Xcoder/Documents/NetBeansProjects/Learnerr/lib/Sys.rb:1:in
`<main>'
Thanks for help !
If your computer doesn't have an ls command, you can do the same thing from
Ruby with Dir.pwd
-Josh
···
On Tue, Jul 2, 2013 at 8:54 AM, xcoder Blue_fox <lists@ruby-forum.com>wrote:
Hey guys i got a probleme with this code :
out = `ls`
puts out
When i run it i got :
C:/Users/Xcoder/Documents/NetBeansProjects/Learnerr/lib/Sys.rb:1:in ``':
No such
file or directory - ls (Errno::ENOENT)
from
C:/Users/Xcoder/Documents/NetBeansProjects/Learnerr/lib/Sys.rb:1:in
`<main>'
Thanks for help !
I guess you rather mean Dir.entries('.') or Dir["*"].
Cheers
robert
···
On Tue, Jul 2, 2013 at 4:26 PM, Josh Cheek <josh.cheek@gmail.com> wrote:
On Tue, Jul 2, 2013 at 8:54 AM, xcoder Blue_fox <lists@ruby-forum.com>wrote:
Hey guys i got a probleme with this code :
out = `ls`
puts out
When i run it i got :
C:/Users/Xcoder/Documents/NetBeansProjects/Learnerr/lib/Sys.rb:1:in ``':
No such
file or directory - ls (Errno::ENOENT)
from
C:/Users/Xcoder/Documents/NetBeansProjects/Learnerr/lib/Sys.rb:1:in
`<main>'
Thanks for help !
If your computer doesn't have an ls command, you can do the same thing
from Ruby with Dir.pwd