TinyBFG
I need help getting this program to work going from windows to mac
So I am making a program that sorts out video files in non-video folders and non-video files in video folders and I am done as far as I can tell but I am having issues getting the program over to the client since it uses paths and I have very minimal experience with mac paths. So every time I try to have them test it the tests fail and it is all around the identifies_path_type_and_formats/1 function on line 72. I am new so general help will be appreciated but specifically, I need help getting this to work on mac. I will leave the GitHub link here. You can call it using mix Erovf “type filepath here”
Most Liked
easco
I suspect the problem in your test is that it is using:
dir = "/erovf/test"
This is an absolute path that starts at the root of the file system. To make it a relative path you could either drop the leading slash erovf/test or you could add a “.” at the front ./erovf/test
I suspect that this is a problematic function:
defp formats_basename(path) do
"/" <> Path.basename(path)
end
Which looks like it might be creating absolute paths when you don’t mean to.
For example if my cwd is /Users/easco/Projects/Elixir/erovf then ask for the base name:
iex(2)> File.cwd!() |> Path.basename()
"erovf"
and formats_basename will turn this into /erovf which is a folder named erovf at the root of the file system and is no longer related to the current working directory.







