I need to check if a user has permissions to create a new file in a folder (i.e. has write access).

I was using:

Qt Code:
  1. QFileInfo fi(my_folder_path);
  2. bool can_write=fi.permission(QFile::WriteUser);
To copy to clipboard, switch view to plain text mode 

But that seems to return based on if the user has permission to write to the folder name itself (i.e. rename it), rather than to write a file inside that folder.

What is the best way to do what I need?

Maybe try creating a temporary file and see if it fails?