Post by meerkat on Jul 3, 2020 12:44:03 GMT -5
I finally wrote my own. It only shows the server side directories. For me, that was ok since client directories was not allowed. It uses DIR for windows, but I think Linux conversion would work using ls/la or something like that.
' ---------------------------------------------
' Directory
' ---------------------------------------------
cr$ = chr$(13)
dirOf$ = "c:\" ' get directory of
bf$ = "<SPAN STYLE='font-family:Courier New; font-weight:700; font-size:10pt'>"
' -------------------------------------------
' Shell out directory
' -------------------------------------------
[dirShell]
cls
html bf$
loc$ = strRep$(dirOf,ドル"*.*","")
x$ = shell$("dir ";dirOf$)
i = 1
while word$(x,ドルi,cr$) <> ""
a$ = word$(x,ドルi,cr$)
if trim$(a$) = "" then goto [next]
if left$(a,1ドル) = " " then goto [next]
if left$(a,1ドル) = cr$ then goto [next]
type$ = mid$(a,26,3ドル)
size$ = mid$(a,30,9ドル)
size$ = strRep$(size,ドル",","")
size = val(size$)
if type$ <> "DIR" and size = 0 then goto [next]
name$ = mid$(a,40ドル)
a$ = strRep$(a,ドル"<","[")
a$ = strRep$(a,ドル">","]")
html left$(a,39ドル)
link #ddir,name,ドル [doDir]
#ddir setkey(type$;"|";loc$;name$)
html "<BR>"
goto [next1]
[next]
print a$
[next1]
i = i + 1
wend
wait
[doDir]
type$ = word$(EventKey,1,ドル"|")
name$ = word$(EventKey,2,ドル"|")
if type$ = "DIR" then
dirOf$ = name$;"\*.*"
goto [dirShell]
end if
print "Selected File:";name$
wait
' --------------------------------
' string replace rep str with
' --------------------------------
FUNCTION strRep$(str,ドルrep,ドルwith$)
ln = len(rep$)
ln1 = ln - 1
i = 1
while i <= len(str$)
if mid$(str,ドルi,ln) = rep$ then
strRep$ = strRep$ + with$
i = i + ln1
else
strRep$ = strRep$ + mid$(str,ドルi,1)
end if
i = i + 1
WEND
END FUNCTION
end
Hope this helps..
Dan