0

My e2e Angular tests create ftp folder that contains subfolders with few files. Then, after test execution I would like to remove the same folder, but I'm getting error "550 Remove directory operation failed.". All (creation, remove) is done by ftp console. What I observed is that it removes folders without problem when it's empty, but when it have some subfolders or files inside, then it doesn't work. Command I'm trying to use is: rm -r foldername in localisation where it's placed. I want remove all files and folders inside (assuming that inside structure is not known).

OldShaterhan
  • 175
  • 1
  • 2
  • 12
  • What *"`ftp` console"*? Windows or Linux? – Martin Prikryl Sep 18 '19 at 08:36
  • Test are running on Ubuntu, but in general I'm talking about https://www.computerhope.com/issues/ch001246.htm – OldShaterhan Sep 18 '19 at 08:42
  • See [FTP Delete non empty directory](https://stackoverflow.com/q/10749517/850848). – Martin Prikryl Sep 18 '19 at 08:53
  • Precising: tests are played automatically on Ubuntu, but it must have option to remove it also on Windows. For us best option would be to remove it without installing anything new. – OldShaterhan Sep 18 '19 at 08:54
  • @MartinPrikryl, this requires installation of lftp, which I'll preferably omit (additional dependency that has to be installed on each machine running test). – OldShaterhan Sep 18 '19 at 09:00
  • What requires an installation of `lftp`? The accepted answer by @EcchiOli uses a plain `ftp`. And I'm pretty sure that those commands work both in Windows and Linux `ftp`. – Martin Prikryl Sep 18 '19 at 09:01
  • Comment to his answer - @EcchiOli solution works only for files, not for subfolders. – OldShaterhan Sep 18 '19 at 09:10
  • 1
    OK, I didn't notice that you need subfolders too. Anyway, it still answers your question. **Plain `ftp` cannot remove subfolders.** You will have to use another client or script it with some more powerful language (e.g. Python). – Martin Prikryl Sep 18 '19 at 09:12

0 Answers0