Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working #10

Open
focussing opened this issue Jul 18, 2017 · 2 comments
Open

Not working #10

focussing opened this issue Jul 18, 2017 · 2 comments

Comments

@focussing
Copy link

focussing commented Jul 18, 2017

Hello!

When do connect, ls, mkdir. The script does not do anything and gives no messages.

ftp.connect(config);
ftp.mkdir("/directory", function(err){});
ftp.pwd(function(err, path) {
    console.log(err);
    console.log(path);
});
ftp.ls("/", function(err, list) {
    console.log(err);
    console.log(list);
});
ftp.close();

Please could you help me?

@humy2833
Copy link
Owner

Since most of it is an asynchronous operation, you can not do anything because the connection is terminated at this point.
For simplicity, you can do the following:

ftp.connect(config);
ftp.mkdir("/directory", function(err){
  ftp.pwd(function(err, path) {
    console.log(err);
    console.log(path);
    ftp.ls("/", function(err, list) {
      console.log(err);
      console.log(list);
      ftp.close();
    });
  });
});

@focussing
Copy link
Author

Thank you! 👍

However it misses some folders:

schermafbeelding 2017-07-18 om 07 44 29

[ { type: 'd',
    size: 0,
    date: Sat Jul 15 2017 05:33:00 GMT+0200 (CEST),
    name: 'logs',
    str: 'drwxrwxrwx   1 user     group           0 Jul 15 03:33 logs' },
  { type: 'd',
    size: 0,
    date: Fri Jun 09 2017 17:09:00 GMT+0200 (CEST),
    name: 'subdomeinen',
    str: 'drwxrwxrwx   1 user     group           0 Jun 09 15:09 subdomeinen' },
  { type: 'd',
    size: 0,
    date: Wed Jun 21 2017 15:54:00 GMT+0200 (CEST),
    name: 'wwwroot',
    str: 'drwxrwxrwx   1 user     group           0 Jun 21 13:54 wwwroot' } ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants