Giampaolo Rodola' wrote:
> On 1 Dic, 00:10, "Martin v. L�wis" <[EMAIL PROTECTED]> wrote:
> > > I would like to know if such function would be correct for verifying
> > > if a link is broken and/or circular.
> >
> > > def isvalidlink(path):
> > > assert os.path.islink(path)
> > > try:
> > >
On 1 Dic, 00:10, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
> > I would like to know if such function would be correct for verifying
> > if a link is broken and/or circular.
>
> > def isvalidlink(path):
> > assert os.path.islink(path)
> > try:
> > os.stat(path)
> > except os.e
> I would like to know if such function would be correct for verifying
> if a link is broken and/or circular.
>
> def isvalidlink(path):
> assert os.path.islink(path)
> try:
> os.stat(path)
> except os.error:
> return 1
> return 0
You meant to flip the result value
Hi there,
I would like to know if such function would be correct for verifying
if a link is broken and/or circular.
def isvalidlink(path):
assert os.path.islink(path)
try:
os.stat(path)
except os.error:
return 1
return 0
--
http://mail.python.org/mailman/listinfo/p