Search code examples
mumpsintersystems-ensemble

Cache Object Script How to MakeDirectory FTP Class


In Cache Object Script how can I make a remote directory on an FTP Server. I do see the class MakeDirectory but that is returning 0 when I call it?

set ftp=##class(%Net.FtpSession).%New()
d ftp.Connect(COMServer,c.Username,c.Password)
d ftp.SetDirectory("/Test")
w ftp.MakeDirectory("6666")
0

Solution

  • This should create directory 6666 under /Test, are you sure /Test exists and you have enough privileges to create directory there?

    You can check ftp.ReturnCode and ftp.ReturnMessage to check for server response.