mpv-player/mpv — pull request #1056 by otommod (2014-08-30 22:50:27+00:00)
Title: Expose mp_getcwd to lua

Say for example that you want to learn what the directory of the current playing file is named. You could use the `path` property and `mp.utils.split_path`, but that could result to a path relative to mpv's launch path. You are therefore going to be needing *that* path. Expose it then, from `mp.utils.getcwd()`! It probably won't work for remote files though.

I tested on Linux and it seems to work. I don't know if `mp.utils` is the right package, I chose it because it contains directory related functions. I don't even know if using a function is the best solution. Maybe a property could be exposed.