Hi,

Karens solution ( if it works - I havn't tried ) may be what you are looking
for.

I would however discourage following soft links ( shortcuts ) when
traversing a tree, or you may get a cyclic link that locks ( and eventually
crashes ) your program. ( think C:\that\this.lnk -> C:\that )

Hard links ( available in MacOS and Linux ) are cyclic safe ( mostly since
directory links aren't allowed ).

Soft links are not cyclic safe in any of these three.

/Þór 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Carlo
Rubini
Sent: 19. október 2006 12:49
To: REALbasicNUGlist Network Users Group
Subject: dealing with dead shortcuts in win32

I'm having some problem when, parsing nested folders in win32 environment,
the loop encounters a shortcut referring to a folder that does not exist
anymore. Meantime, I noticed that even if the icon of such shortcut is that
of a folder, the shortcut itself is a file with the extension .lnk

No use to say something like: if f.item(i) <> nil and f.item(i).exists then
doSomething; because f.item(i) will go through the loop and generate the
following system-message:
"The drive or network connection that the shortcut 'foo.lnk' refers to is
anavailable. Make sure etc etc."

The workaround that at present works for me is to do this:

for i = 1 to f.count
  if f.item(i).directory then
     //do recursion
  else
     f = f.item(i)
    //I even tried adding: f = f.parent.child(f.name) but it is an
unecessary step
    //do something with f
  end if
next

So here is my question: is there a simpler way to block a dead shortcut?
(Sorry, but I'm not a windows man).

Thanks,

--
Carlo
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to