简体   繁体   中英

Does CreateDirectory apply DirectorySecurity on pre-existing directory?

For CreateDirectory API ( in particular the managed one): https://msdn.microsoft.com/en-us/library/54a0at6s(v=vs.110).aspx

Directory.CreateDirectory Method (String, DirectorySecurity)

If the directory exists, does this call also update the DirectorySecurity?

Or does it silently ignore since the creation failed. Documentation doesn't mention that. It only says: "This object is returned regardless of whether a directory at the specified path already exists."

No it doesn't change the instance of DirectorySecurity in any way. You can check it for yourself here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM