On 2016-04-29, eryk sun <eryk...@gmail.com> wrote:
> On Fri, Apr 29, 2016 at 6:51 AM, Jussi Piitulainen
><jussi.piitulai...@helsinki.fi> wrote:
>> Adam Funk writes:
>>> On 2016-04-28, Grant Edwards wrote:
>>
>>>> Or just do os.access("directory/where/you/want/to/open/a/file",os.W_OK)
>>>
>>> That's what I'm doing now, but I prefer to give the user the error
>>> message early on.
>>
>> Then do that early on.
>
> Note that on Windows os.access only checks if a file is read-only.
> There's a proposed update to check the file security. The patch needs
> to be updated and needs to be reworked, but it's a low priority. For
> the most part calling os.access isn't recommended.

I'm sure there are probably other ways that it fails also.  That's why
it's almost always simpler and better to just open the file in write
mode and see if it works.

--
Grant


-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to