Hi Alejandro,
>How can you find out programmatically to which directory or share is a disk letter mapped?
>
>For example Z: may be mapped to "\\MyServer\MyServer_Z"
>
>TIA,
>
>Alex
this is a rough code snippet of mine
FUNCTION ConvertDrive2UNC
LPARAMETERS vLocalName
LOCAL lcUNCBuffer as String, liLength as Integer, lcLocalName as String, lcRemoteName as String
DECLARE INTEGER WNetGetConnection IN WIN32API ;
STRING @ lpLocalName, ;
STRING @ lpRemoteName, ;
INTEGER @ lpliLength
IF LEN(m.vLocalName) = 1
m.vLocalName = m.vLocalName + [:]
ENDIF
lcUNCBuffer = REPL(CHR(0),261)
liLength = LEN(lcUNCBuffer)
IF WNetGetConnection(m.vLocalName, @lcUNCBuffer, @liLength) = 0
lcRemoteName = LEFT(lcUNCBuffer,AT(CHR(0),lcUNCBuffer)-1)
ENDIF
RETURN lcRemoteName
ENDFUNC
Best Regards
-Tom
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it.
Oh, and BTW: 010101100100011001010000011110000101001001101111011000110110101101110011