How to check if a file can be created inside given directory on MS XP/Vista?
I have a code that creates file(s) in user-specified directory. User can point to a directory in which he can't create files, but he can rename it. I have created directory for test purposes, let's call it C:\foo . I have following permissions to C:\foo : Traversing directory/Execute file Removing subfolders and files Removing Read permissions Change permissions Take ownership I don't have any of the following permissions to C:\foo : Full Control File creation Folder creation I have tried following approaches, so far: os.access('C:\foo', os.W_OK) == True st = os.stat('C:\foo') mode = st[stat