path-io icon indicating copy to clipboard operation
path-io copied to clipboard

Better reporting or documentation of failed folder creations due to search permissions

Open TimeTravelPenguin opened this issue 7 months ago • 0 comments

I am using an Apple M3 Max, Sonoma Version 14.1.2 (23B2091), using path-io v1.8.1.

I just spent some time debugging a personal project of mine, trying to figure out why ensureDir (more generally createDir). In my application, I am currently just simply storing a json config in the application directory. However, when using stack, this executable is in a directory where all privileges except searchable are given.

When using ensureDir to make sure a subdirectory exists to write some files into, the application throws an error:

myApp-exe: /path/to/.../.stack-work/install/aarch64-osx/.../bin/myApp-exe: createDirectory: inappropriate type (Not a directory)

The docs specify:

InappropriateType The path refers to an existing non-directory object. [EEXIST]

But this didn't really help in solving the problem.

While this is clearly an issue for me to better manage in my application to avoid this problem, either better documentation or reporting would be helpful.

Thanks

TimeTravelPenguin avatar Dec 08 '23 05:12 TimeTravelPenguin