will49
11th September 2008, 16:26
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:
QFileInfo fi(my_folder_path);
bool can_write=fi.permission(QFile::WriteUser);
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?
I was using:
QFileInfo fi(my_folder_path);
bool can_write=fi.permission(QFile::WriteUser);
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?