Skip to content

Commit c960d00

Browse files
author
Steven Taylor
committed
isolating issue to be property / getter
1 parent 20f74e1 commit c960d00

File tree

2 files changed

+29
-27
lines changed

2 files changed

+29
-27
lines changed

FtpProvider/FtpProvider/FtpProvider.fs

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ type FtpProviderImpl(config : TypeProviderConfig) as this =
5353

5454
td.AddMembersDelayed(fun () ->
5555
// TODO.6
56-
if diag then printfn "debug: getting site: %s, user: %s, pwd: %s" site user (String.replicate (pwd.Length) "#")
56+
if diag then printfn "debug: getting site: %s, user: %s, pwd: %s" site user (String.replicate (pwd.Length) "*")
5757
let files, dirs = getFtpDirectory (site, user, pwd)
5858

5959
[
@@ -71,31 +71,31 @@ type FtpProviderImpl(config : TypeProviderConfig) as this =
7171

7272
let contentsProperty =
7373
ProvidedProperty("Contents", typeof<obj>,
74-
GetterCode =
75-
(fun args ->
76-
<@@
77-
if diag then printfn "debug: getting %s%s" site file
78-
let request = WebRequest.Create(site + file) :?> FtpWebRequest
79-
80-
if diag then printf " - debug: 1)getting"
81-
request.Method <- WebRequestMethods.Ftp.DownloadFile
82-
request.Credentials <- new NetworkCredential(user, pwd)
83-
let response = request.GetResponse() :?> FtpWebResponse // TODO.2
84-
85-
if diag then printf ",2)streaming"
86-
use responseStream = response.GetResponseStream()
87-
use reader = new StreamReader(responseStream)
88-
89-
if diag then printf ",3)reading"
90-
let r = reader.ReadToEnd() :> obj
91-
if diag then printfn ",4)returning info"
92-
r
93-
94-
// TODO.3
95-
96-
@@>))
74+
GetterCode = (fun args -> <@@ "the file contents" @@> ))
75+
// GetterCode =
76+
// (fun args ->
77+
// <@@
78+
// if diag then printfn "debug: getting %s%s" site file
79+
// let request = WebRequest.Create(site + file) :?> FtpWebRequest
80+
//
81+
// if diag then printf " - debug: 1)getting"
82+
// request.Method <- WebRequestMethods.Ftp.DownloadFile
83+
// request.Credentials <- new NetworkCredential(user, pwd)
84+
// let response = request.GetResponse() :?> FtpWebResponse // TODO.2
85+
//
86+
// if diag then printf ",2)streaming"
87+
// use responseStream = response.GetResponseStream()
88+
// use reader = new StreamReader(responseStream)
89+
//
90+
// if diag then printf ",3)reading"
91+
// let r = reader.ReadToEnd() :> obj
92+
// if diag then printfn ",4)returning info"
93+
// r
94+
//
95+
// // TODO.3
96+
//
97+
// @@>))
9798
nestedType.AddMember contentsProperty
98-
9999
yield nestedType :> MemberInfo
100100
]
101101
)

FtpProvider/test.fsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
type F = FSharp.Management.FtpProvider<"ftp://ftp.ncbi.nlm.nih.gov/">
44

5-
F.genomes.Drosophila_melanogaster.``RELEASE_4.1``.CHR_2.``NT_033778.faa`` // see: FtpProvider.fs -> BUG.1
5+
F.genomes.Drosophila_melanogaster.``RELEASE_4.1``.CHR_2.``NT_033778.faa``
66

7-
// F.genomes.Drosophila_melanogaster.``RELEASE_4.1``.CHR_2.``NT_033778.faa``.Contents // ie. we're not getting to the .Contents
7+
// see: FtpProvider.fs -> BUG.1
8+
9+
// F.genomes.Drosophila_melanogaster.``RELEASE_4.1``.CHR_2.``NT_033778.faa``.Contents // ie. we're not even getting to the .Contents
810

911
// F.genomes.Buceros_rhinoceros_silvestris.RNA.``Gnomon.mRNA.fsa.gz``

0 commit comments

Comments
 (0)