What function/method should I use for file_directory_path()?
You can use the following code.

$real_path = \Drupal::service('file_system')-&gt;realpath(file_build_uri(''));


On my test site, it returns '/Library/Server/Web/Data/Sites/avpnet/sites/default/files'.

You can also pass a filename to file_build_uri().

$real_path = \Drupal::service('file_system')-&gt;realpath(file_build_uri('file.jpeg'));


With this code, I get '/Library/Server/Web/Data/Sites/avpnet/sites/default/files/file.jpeg'.