From: Tom Hughes Date: Wed, 18 Jul 2007 08:37:46 +0000 (+0000) Subject: Use a full path to find the file command. X-Git-Tag: live~8263 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/30f740178f9dcae12e577229555471428df77b5e?hp=16358a1d39d96a2d04ab410731c9edcdf155606b Use a full path to find the file command. --- diff --git a/app/models/trace.rb b/app/models/trace.rb index ed0ba72e8..8f99e7bd8 100644 --- a/app/models/trace.rb +++ b/app/models/trace.rb @@ -73,7 +73,7 @@ class Trace < ActiveRecord::Base end def mime_type - filetype = `file -bz #{trace_name}`.chomp + filetype = `/usr/bin/file -bz #{trace_name}`.chomp gzipped = filetype =~ /gzip compressed/ bzipped = filetype =~ /bzip2 compressed/ zipped = filetype =~ /Zip archive/ @@ -92,7 +92,7 @@ class Trace < ActiveRecord::Base end def extension_name - filetype = `file -bz #{trace_name}`.chomp + filetype = `/usr/bin/file -bz #{trace_name}`.chomp gzipped = filetype =~ /gzip compressed/ bzipped = filetype =~ /bzip2 compressed/ zipped = filetype =~ /Zip archive/ @@ -141,7 +141,7 @@ class Trace < ActiveRecord::Base logger.info("GPX Import importing #{name} (#{id}) from #{user.email}") # TODO *nix specific, could do to work on windows... would be functionally inferior though - check for '.gz' - filetype = `file -bz #{trace_name}`.chomp + filetype = `/usr/bin/file -bz #{trace_name}`.chomp gzipped = filetype =~ /gzip compressed/ bzipped = filetype =~ /bzip2 compressed/ zipped = filetype =~ /Zip archive/