This is such a noobie question.
I have a file,
I want to do two simple things:
I want to get the file size.
I want to read a few hundred bytes from the beginning of the file so
as to pick up te flv’s time duration.
Are there RoR and/or Ruby facilities to do this?
Well the File lass has a size method and you can open files and read
them with sysread which is available in the IO class (which you get
when you open a file)
Also this has nothing to do with RoR
Tuesday, January 3, 2012, 2:37:35 AM, you wrote:
PH> Well the File lass has a size method and you can open files and read
PH> them with sysread which is available in the IO class (which you get
PH> when you open a file)
PH> Also this has nothing to do with RoR
At least on my machine
Errno::EINVAL: Invalid argument -
size' from (irb):2 from C:/RailsInstaller/Ruby1.9.2/bin/irb:12:in’
So File.size() seems to work on local files and not web-based files.
I’ll take this to the ruby chat list.
just use these
response = http.request_head(RemoteAddress)
file_size = response[‘content-length’]
Josh Software Private Limited http://www.joshsoftware.com
6, Thube Park,
Pune - 411005
File size of web-based flv can be customized with the assistance of https://errorcode0x.com/resolve-kaspersky-antivirus-error-1922/ and you can also get information on it.