lib/elements_of_interest/util.rb
# Fixes File name too long @ rb_sysopen (255 max)
#
# Trims the file name for given output path to ensure the overall path is < 255
# @param file_name [String] file name including ext. ex: somefile
# @param output_lenght [String] the length of the path (file name.length + output_dir.length)
# @param ext_name [String] extension for the file. ex: '.uix'
Fixes File name too long @ rb_sysopen (255 max)
Trims the file name for given output path to ensure the overall path is < 255
Fixes File name too long @ rb_sysopen ( 255 max ) Trims the file name for given output path to ensure the overall path is < 255
def trim_file(file_name, output_length, ext_name)
      result = file_name
      result = file_name[0..254 - output_length - ext_name.length] + ext_name if output_length > 255
      result
    end
def trim_file ( file_name , output_length , ext_name ) result = file_name result = file_name [ 0 .. 254 - output_length - ext_name . length ] + ext_name if output_length > 255 result end
Fixes File name too long @ rb_sysopen (255 max)
Trims the file name for given output path to ensure the overall path is < 255
Fixes File name too long @ rb_sysopen ( 255 max ) Trims the file name for given output path to ensure the overall path is < 255
file_name
file name including ext. ex: somefile
file name including ext . ex : somefile
output_length
ext_name
extension for the file.
extension for the file .
output_lenght
None