method
size
v2_4_6 -
Show latest stable
- Class:
Net::FTP
size(filename)public
Returns the size of the given (remote) filename.
# File lib/net/ftp.rb, line 1173
def size(filename)
with_binary(true) do
resp = sendcmd("SIZE #{filename}")
if !resp.start_with?("213")
raise FTPReplyError, resp
end
return get_body(resp).to_i
end
end Related methods
- Instance methods
- abort
- acct
- binary=
- chdir
- close
- closed?
- connect
- delete
- dir
- get
- getbinaryfile
- getdir
- gettextfile
- help
- list
- login
- ls
- mdtm
- mkdir
- mlsd
- mlst
- mtime
- nlst
- noop
- put
- putbinaryfile
- puttextfile
- pwd
- quit
- read_timeout=
- rename
- retrbinary
- retrlines
- return_code
- return_code=
- rmdir
- sendcmd
- set_socket
- site
- size
- status
- storbinary
- storlines
- system
- voidcmd
- Class methods
- default_passive
- default_passive=
- new
- open
- Private methods
-
get_body -
getline -
getmultiline -
getresp -
makepasv -
makeport -
open_socket -
parse227 -
parse228 -
parse229 -
parse257 -
parse_mlsx_entry -
parse_pasv_ipv4_host -
parse_pasv_ipv6_host -
parse_pasv_port -
putline -
sanitize -
send_type_command -
sendport -
start_tls_session -
transfercmd -
voidresp -
with_binary