John Gunvaldson wrote:
Remove folders from example:
\\server\share\folder1\folder2\folder3\folder4\filename.ext
Remove folders from example:
C:\folder1\folder2\folder3\folder4\filename.ext
*--*
What I would like to return is just the individual folder names, never
the drive letter, never the server, never the share name and never the
filename itself...
Returns for example: folder1\folder2\folder3\folder4\ <-- I will use
this to ensure a destination folder structure is created just past the
share name...
How about:
<vfpcode>
lcPath = "\\server\share\folder1\folder2\folder3\folder4\filename.ext"
*lcPath = "C:\folder1\folder2\folder3\folder4\filename.ext"
lcFldrs = ""
lnFolders = ALines(aFolders, JustPath(lcPath), 4, "\")
*-- Check if this is a UNC
If Empty(JustDrive(lcPath))
*UNC, the usefull information stars at third row
lnRow = 3
Else
*-- Drive Letter, Start at second row:
lnRow = 2
EndIf
*-- Folder structure
For lnI = lnRow To lnFolders
lcFldrs = lcFldrs + "\" + aFolders(lnI)
next
?lcFldrs
</vfpcode>
Note: in versions prior to 9, substitute the parameter 4 in alines()
with .T.
HTH
Saldos
Jaime Vasquez
Guatemala C.A.
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.