module JF_utils

  $JF_VERSION= 3


  @@num_uniq = 0

  def JF_utils::uniq(path)
#verifier si le fichier existe
#	print "uniq from: #{path}"
    @@num_uniq +=1
    unless path.nil?
      filename = path[path.rindex('/')+1..-1]
      if filename.rindex('.').nil? 
        file = filename
        ext=nil
      else
        file = filename[0...filename.rindex('.')] 
        ext = '.'+filename[filename.rindex('.')+1..-1]
      end
    end
#	puts " to: #{file}_#{@@num_uniq.to_s}#{ext}"
    "#{file}_#{@@num_uniq.to_s}#{ext}"
  end

  def JF_utils::filename(path)
#verifier si le fichier existe
    unless path.nil?
      path[path.rindex('/')+1..-1]
    end
  end


end # module
