Page 1 of 1

Getting the directory of Wing FTP user through Command Line

Posted: Wed Nov 25, 2009 10:13 am
by mellul
Hi,

I have been able to get string from the output of c_GetUser through an asp file. I have also divided that string into an array so that I would be able to retrieve only parts of the string such as username and max quota to print them to a web page.

I seem to be having dificulty with the directory. What c_GetUser gives is 'directories' => table. I need to pull out the actual directory of the ftp client so I would know where the clients files are stored on the server. Is there a way to do this? Is there another function other than c_GetUser that I can use, that may not be listed on the online help? Or is there another way around this?

Thanks again for your help. It is greatly appreciated.

Re: Getting the directory of Wing FTP user through Command Line

Posted: Wed Nov 25, 2009 2:36 pm
by FTP
You may find the reference in the help document.

[32]table user's directory list (directory table is formated as
{m_strDir,m_strAlias,m_bIsHomeDir,m_bFileRead,m_bFileWrite,m_bFileAppend,m_bFileDelete,
m_bDirectoryList,m_bDirectoryMake,m_bDirectoryDelete,m_bDirFileRename}).

Re: Getting the directory of Wing FTP user through Command Line

Posted: Wed Nov 25, 2009 3:51 pm
by mellul
Thanks for your reply.

My question was how can I extract that table from it. Is there a way that I can store the output of that command as an array inside LUA itself and just var_dump the contents of that table? I cannot do this outside Lua as the ans given is a string.

I have tried storing the answer inside a variable but it does not seem to work:

a = var_dump(c_GetUser('test','test'))

I have also tried:

a = {c_GetUser('test','mellul')}
var_dump(a)

but it does not seem to work.

If you can explain what I should do inside LUA I think it would be of great help.

Thanks again for your help.

Re: Getting the directory of Wing FTP user through Command Line

Posted: Thu Nov 26, 2009 3:21 am
by FTP
Type the following code:
var_dump(json.encode(c_GetUser("domain","username")))

I think this may help you, and I sugguest you should learn the lua language a bit further.

Re: Getting the directory of Wing FTP user through Command Line

Posted: Thu Nov 26, 2009 8:29 am
by mellul
Thankyou for all your help.

I would like you to note that I had to learn the LUA language in less than a couple of days, together with ASP as I have never worked with these before. I had a 2 week deadline to write some scripts. I will be learning the language further in the next few weeks as this is the first time I have even heard about the language.

So I would really like to thank you for your help. I do appreciate it :)

Re: Getting the directory of Wing FTP user through Command Line

Posted: Thu Nov 26, 2009 11:32 am
by FTP
That seems it is so hard for you, can you tell me more detail information about this job? And has your company purchased our product?

Re: Getting the directory of Wing FTP user through Command Line

Posted: Thu Nov 26, 2009 2:00 pm
by mellul
Basically at the moment we are using another FTP server. This FTP server is linked to another server so addition/removal/queries and changes can be made through our intranet. The time has come to replace this FTP server and I have been testing your product to make sure we can replace our FTP server without changing the internal website and other server settings.

To test this I had to build everything from scratch on our new server which will be used for FTP and websites. We have not bought your product yet but I am waiting for the go ahead to buy it. It has gotten a big thumbs up from me and my work mates as we see alot of potential in your product. Through your help, I have been able to rewrite all the scripts and I have also been thinking about other things which will make the lives of the help desk and technicians (including my own) alot easier.

These past few days I have had to prove that your product is a good one for our company. During the next few weeks we should be purchasing your product :)

I thank you again for all your help.

Re: Getting the directory of Wing FTP user through Command Line

Posted: Thu Nov 26, 2009 5:09 pm
by FTP
Thanks for choosing our software, I hope you can resolve all the problem for migration and have a more powerful ftp server!