0

I have the following directories on the root of my server

  • htdocs
    • [site contents]
  • mike-eng
    • stage
  • old2
  • stats

I am trying to delete the "mike-eng" directory here.

Permissions on "mike-eng" and "stage" are 777. Neither directory is showing any files in my FTP client (Transmit), which shows hidden files in other directories. Also, the command line shows the directories as empty:

ftp> cd mike-eng

250 CWD command successful

ftp> ls

229 Entering Extended Passive Mode (|||29910|)

150 Opening ASCII mode data connection for file list

drwxrwxrwx 2 1191966 15000 4096 Jan 11 15:55 stage

226 Transfer complete

ftp> cd stage

250 CWD command successful

ftp> ls

229 Entering Extended Passive Mode (|||48904|)

150 Opening ASCII mode data connection for file list

226 Transfer complete

When I try to delete the "mike-eng" directory using Transmit, I get the following error:

stage: Directory not empty

Error -126: remote rmdir failed

When I connect using Terminal and try to delete the "mike-eng" directory from the command line, I get:

ftp> rm mike-eng

550 mike-eng: Directory not empty

If I navigate inside the "mike-eng" directory and try to delete the "stage" directory, I get:

ftp> rm stage

550 stage: Directory not empty

How can I delete this directory and its sub-directory?

0

3 Answers 3

3

There's probably a hidden file in mike-eng. Try

ftp> cd mike-eng
ftp> mdelete .*
ftp> cd ..
ftp> rmdir mike-eng
3
  • ftp> cd mike-eng 250 CWD command successful ftp> mdelete .* ftp> cd .. 250 CWD command successful ftp> ls 229 Entering Extended Passive Mode (|||8848|) 150 Opening ASCII mode data connection for file list -rw-r--r-- 1 1191966 15000 6819809280 Jan 6 16:43 backupfull.tar drwxr-xr-x 17 1191966 15000 4096 Jan 10 22:15 htdocs drwxrwxrwx 3 1191966 15020 4096 Jan 11 15:58 mike-eng drwxr-xr-x 12 1191966 15000 4096 Jul 5 2009 old2 drwxr-xr-x 2 1191966 15000 24576 Jan 16 10:24 stats 226 Transfer complete ftp> rmdir mike-eng 550 mike-eng: Directory not empty
    – Mike Eng
    Commented Jan 16, 2012 at 21:05
  • @MikeEng: hmm, I guess the mdelete didn't catch everything. Can you try an ls .* in dir mike-eng?
    – Fred Foo
    Commented Jan 16, 2012 at 22:56
  • ftp> cd mike-eng 250 CWD command successful ftp> ls .* 229 Entering Extended Passive Mode (|||46930|) 150 Opening ASCII mode data connection for file list 226 Transfer complete ftp>
    – Mike Eng
    Commented Jan 17, 2012 at 1:30
1

No explanation for the cause of this, but the only way I was able to delete the directory was using my host(Powweb)'s "file manager" in the control panel.

1
  • Same here. Uploaded file had some weird character in it, and FTP couldn't browse to it, rename it, etc. Host file manager worked.
    – Lanny
    Commented Jul 30, 2014 at 0:28
1

I just had the same problem. It seems it's not the server, but a bug in Transmit.

Here's the solution that worked with me:

  1. In Transmit's interface, open the directory that won't delete
  2. Once opened, right click inside the directory and click: “Refresh”. Some files will show up!
  3. Delete those files that came up and then now deleting the directory will work fine
  4. Repeat that for all directories that present that error

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .