Dmitriy
Dmitriy

Reputation: 5497

How to find out whether a folder require administrative privileges to modify its contents?

Given a path to a folder how to find out whether my application needs administrative privileges to create, delete or modify files into this folder?

Qt 5 Windows 8.1

I'd preffer a cross-platform solution. But platform specific will do too.

Upvotes: 2

Views: 132

Answers (1)

svlasov
svlasov

Reputation: 10455

Use QFileInfo::isWritable():

if (fileInfo.isDir() && fileInfo.isWritable()){
....
}

Upvotes: 1

Related Questions