Print an error when trying to open a dir as a file
Prevents unnecessary stack tracesunstable
parent
0c3f1aab77
commit
585245501a
|
@ -124,6 +124,9 @@ class Console::CommandDispatcher::Stdapi::Fs
|
|||
return true
|
||||
end
|
||||
|
||||
if (client.fs.stat(args[0]).directory?)
|
||||
print_error("#{args[0]} is a directory")
|
||||
else
|
||||
fd = client.fs.file.new(args[0], "rb")
|
||||
|
||||
until fd.eof?
|
||||
|
@ -131,6 +134,7 @@ class Console::CommandDispatcher::Stdapi::Fs
|
|||
end
|
||||
|
||||
fd.close
|
||||
end
|
||||
|
||||
true
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue