igmonplugins icon indicating copy to clipboard operation
igmonplugins copied to clipboard

Add folder writability check

Open seqizz opened this issue 1 year ago • 3 comments

Generic but not-so-clever check to test writability of a folder. Explicitly needs most of the parameters since this is originally intended to check Seaweedfs' mounted folders to be writable or not.

seqizz avatar Jul 30 '24 14:07 seqizz

Maybe I am missing your case but can't you just for example:

>>> import os
>>> os.access("/home/kofrezo/Desktop", os.W_OK)
True
>>> os.access("/home/kofrezo/Desktop", os.X_OK)
True

kofrezo avatar Jul 30 '24 14:07 kofrezo

I basically could not trust what remote filesystem reports to OS vs what is actually possible. Otherwise yeah, it'd be just that :( Write is done in usual way but read is validated by an arbitrary command (in current case weed filer.cat, but might be anything like a call to an API of local app etc.)

seqizz avatar Jul 30 '24 14:07 seqizz

Approved it. None of my comments is blocking and I think you applied those you want.

kofrezo avatar Aug 01 '24 15:08 kofrezo