File Types
Mix.install([
{:kino, github: "livebook-dev/kino", override: true},
{:kino_lab, "~> 0.1.0-dev", github: "jonatanklosko/kino_lab"},
{:vega_lite, "~> 0.1.4"},
{:kino_vega_lite, "~> 0.1.1"},
{:benchee, "~> 0.1"},
{:ecto, "~> 3.7"},
{:math, "~> 0.7.0"},
{:faker, "~> 0.17.0"},
{:utils, path: "#{__DIR__}/../utils"},
{:tested_cell, git: "https://github.com/BrooklinJazz/tested_cell"}
])
Navigation
File Types
Create a FileTypes
module which can display the number of files of a given type in a folder.
For example, we have create a file_types
folder with several files inside of it.
File.ls!("data/file_types")
Provided a folder, your FileTypes
module should return the number of files by their extension.
[txt: 2, ex: 2, png: 1, jpg: 1] = FileTypes.find("data/file_types")
Enter your solution below.
defmodule FileTypes do
def find(folder) do
end
end
Commit Your Progress
Run the following in your command line from the project folder to track and save your progress in a Git commit.
$ git add .
$ git commit -m "finish file types exercise"