Directory not empty warning from rmdir, but only sometimes.

I have a script with a snippet with this logic:

if ($flag)
{
	$file1 = $filepath1;
	$file2 = $filepath2;
	$collection->insertOne($file1);
	$bytes = fopen($file2, "rb");
	$bucket->uploadFromStream($name, $bytes);	
}
unlink($filepath1);
unlink($filepath2);
rmdir($dir);

If $flag is true, a couple of files and containing directories are then deleted. This case works fine.

If $flag is false, the files are supposed to be uploaded to my local Mongo instance before being deleted. When this happens, I get a warning "Directory not empty in XXXXX on line YY". The files upload, the files get deleted, and the folder remains with nothing inside it. Could anyone suggest a workaround for this?

πŸ‘︎ 3
πŸ“°︎ r/PHPhelp
πŸ’¬︎
πŸ‘€︎ u/sfitznott
πŸ“…︎ Apr 12 2021
🚨︎ report
ZFS on root can't mount because directory not empty

I have installed ArchLinux on a ZFS filesystem, and from the title, that's the message I get on boot from zfs-mount.service.

However, it seems like everything mounts fine. From Google, I saw that a few people had the same error because the directories were being created before ZFS tries to actually mount them. But I'm not sure how to fix it.

zfs list has this output: http://ix.io/2Dky

When I boot from a life USB, and run 'zpool import -a -R /mnt' I see that without mounting anything (zfs mount -a), the /var directory, the /root directory, and the /home directory all show up in /mnt, with all their files.

This doesn't make sense to me, since I haven't imported the root dataset (zfs mount zroot/ROOT/default) or everything else.

If I attempt to mount zroot/ROOT/default, it says "cannot mount - /mnt not empty". Which seems like the same problem.

How can I fix this? Thanks so much.

πŸ‘︎ 3
πŸ“°︎ r/zfs
πŸ’¬︎
πŸ‘€︎ u/NateDevCSharp
πŸ“…︎ Nov 07 2020
🚨︎ report
Can't remove folder on macOS - Directory not empty

I have strange problem with removing empty folder on macOS Catalina.

Right now I have ended up with new ideas how to remove that thing.

[email protected]:~/a$ ls -laf delme/
total 0
drwx------  3 felixd  staff   96  4 cze  2018 .
drwxr-xr-x  5 felixd  staff  160  8 maj 20:55 ..

[email protected]:~/a$ rm -rf delme/

rm: delme/: Directory not empty

This folder is not being used by any application. I have already tried to remove it while starting macOS in rescue mode.

Thanks for your help in advance. I have asked same question on StackOverflow

https://stackoverflow.com/questions/61686332/cant-remove-folder-on-macos-directory-not-empty

πŸ‘︎ 3
πŸ“°︎ r/MacOS
πŸ’¬︎
πŸ‘€︎ u/felixdPL
πŸ“…︎ May 08 2020
🚨︎ report
Removing empty directories...(no, it's not as simple as this sounds)

I have a rather large music collection (100+GB) and somehow or another, some program down the line created a bunch of folders above where the music should be.

For example, the files should be in \music\artist\album\track.flac/mp3

However, they are now in \music\artist\album\artist\album\artist\album\track.flac/mp3.

What would be the simplest way of removing those empty middle albums and bringing everything back up to where it should be in the tree?

(i'm moderately experienced with *nix, but am not so good at scripting).

Thanks

πŸ‘︎ 8
πŸ“°︎ r/linuxquestions
πŸ’¬︎
πŸ‘€︎ u/dietrichmd
πŸ“…︎ Jan 08 2020
🚨︎ report
Directory Not Empty Errors When Updating Python?
πŸ‘︎ 7
πŸ“°︎ r/termux
πŸ’¬︎
πŸ‘€︎ u/sonic65101
πŸ“…︎ Nov 18 2019
🚨︎ report
[QUESTION] Can't install custom IPA's using AltServerPatcher "remove: The directory is not empty.:" Any fix? imgur.com/a/tCG2YZX
πŸ‘︎ 2
πŸ“°︎ r/sideloaded
πŸ’¬︎
πŸ‘€︎ u/dwojc6
πŸ“…︎ Feb 10 2020
🚨︎ report
I clones a specific branch of a github repo to my local machine, made some changed, then pushed to the github website. Now I wanted to push the same change to another branch. But when I try to clone that branch, it says "fatal: destination path 'NLUE' already exists and is not an empty directory."

So my next thought is, I should just make a new directory for each branch of the repo. But I am wondering, there's probably a system Github has done for this.

So I looked online and there does seem to be this.

https://stackoverflow.com/questions/44770836/editing-a-branch-in-git

But I am having a hard time following this.

First, it looks like I should just clone the whole repo, and not a specific branch from the repo.

Then the next steps seems to be

git checkout newbranch

So I am wondering what's happening when I do this. I think either one of two things happen

A: When I cloned the repo, it also cloned all of the branches onto my computer, and they are all just hidden, but when I do git checkout newbranch , then apparent files on my computer changes to that branch.

B: Only the master is on my computer, and when I do git checkout newbranch , it replaces the files on my computer with the online branch I specified.

C: Something else.

πŸ‘︎ 3
πŸ“°︎ r/learnprogramming
πŸ’¬︎
πŸ“…︎ Nov 17 2019
🚨︎ report
Show in i3bar if a queue exists (directory not empty)

Dear I3rs.

I have a queue in a directory and I'd like to see if it's not empty using something simple in i3bar. It's enough to just show a red circle or text (that is not important) if the directory has something. If it's empty, just don't show anything.

I've read the docs but still don't know enough to be able to cook something, so any reference or pointer would be much appreciated.

Thanks a lot in advance for your kind help... :)

πŸ‘︎ 2
πŸ“°︎ r/i3wm
πŸ’¬︎
πŸ‘€︎ u/edumerco
πŸ“…︎ Oct 17 2019
🚨︎ report
AGPM Help - The directory is not empty on deploy

Hi,

We use AGPM to manage our GPOs, one of which is a Software Restriction Policy with about 150 certificate rules in it.

Every time one of us tries to deploy this GPO after making a change, we have to retry anywhere from 2 to 50 times, with most tries resulting in a failure:

Deploy GPO: Software Restriction Policy...Failed

The overall error was: The directory is not empty. (Exception from HRESULT: 0x80070091)

 ----------------------------------------------------------------------

1 actions failed.

https://imgur.com/5hzjI9v

Eventually after enough retries, the deploy is successful.

Does anyone have any idea how I can fix this error, and improve our management experience?I'm open to both fixes for this particular error, or criticism of how we've implemented SRP.

Cheers =]

πŸ‘︎ 3
πŸ“°︎ r/sysadmin
πŸ’¬︎
πŸ‘€︎ u/wipash
πŸ“…︎ Aug 19 2019
🚨︎ report
How to Fix "The Directory is not empty." error in Hakchi2 CE. imgur.com/a/Ko2Ef
πŸ‘︎ 7
πŸ“°︎ r/miniSNESmods
πŸ’¬︎
πŸ‘€︎ u/viral_dna
πŸ“…︎ Apr 06 2018
🚨︎ report
command "mountvol F:\ /S", get error "directory not empty"

I'm trying to mount EFI system on a specified unit, in this case F:. The problem is that when i try to use the command "mountvol F:\ /S", in the windows cmd, i get the error "directory not empty". I have searched on the internet but couldn't find somethinf helpful. Do you have any suggestion?

πŸ‘︎ 4
πŸ“°︎ r/commandline
πŸ’¬︎
πŸ‘€︎ u/FireFox1616
πŸ“…︎ Mar 21 2018
🚨︎ report
Lost save due to "directory not empty"

Oh, I'm so frustrated. :'(

Once the recent experimental update was installed I got the error message "directory not empty", and lost my save.

Had to delete everything but the launcher and lost my settings too. Though this is not the first time I ran into the issue, this time it's just too much to take, considering the game I had. Don't say I'm done with CDDA, but certain vacation is absolutely in order.

Anyone had this problem? My backups were off and I don't believe they are a feasible solution. This simply suxx...

πŸ‘︎ 4
πŸ“°︎ r/cataclysmdda
πŸ’¬︎
πŸ‘€︎ u/Aettiro
πŸ“…︎ Oct 29 2017
🚨︎ report
rm: Cannot remove 'folder/': Directory not empty (broken folder)

I have a broken folder in my usb hdd.

as a root i run: rm -fR folder/ > rm: Cannot remove 'folder/': Directory not empty

Then i go to folder and write ls: > ls: reading directory '.': Input/output error

How to delete this folder?

πŸ‘︎ 2
πŸ“°︎ r/linux4noobs
πŸ’¬︎
πŸ‘€︎ u/mastis
πŸ“…︎ Apr 02 2018
🚨︎ report
Error Message "Selected directory not empty"

Hi!

I am having some issues with the usb mod. Not with the "hacking" itself but with game exporting, the first time I added games to the usb disk it worked well but, whenever I try to export games to ANY directory that already has any of the hakchi folder structure it shows this error message:

"Selected directory not empty"

From what I can gather, it is an issue with folder permissions but, no matter what I do, it will always give this error even when I set all permissions for my username or even when using an administrator profile. I am using windows 10 for these tasks.

Can anyone light me the way to proceed?

Thanks everyone.

πŸ‘︎ 4
πŸ“°︎ r/miniSNESmods
πŸ’¬︎
πŸ‘€︎ u/jackic2
πŸ“…︎ Nov 28 2017
🚨︎ report
"The directory is not empty" error message

Hi guys, I will randomly get an error message that says "The directory is not empty. Please try again." when syncing games. Any idea what that's about? I'm using version 2.11

I was able to mod two consoles without any problems. It's done this three times on the third console. Each time I do it, I create a new hakchi directory from the zip file and just copy the games folder.

πŸ‘︎ 4
πŸ“°︎ r/nesclassicmods
πŸ’¬︎
πŸ‘€︎ u/vj1096
πŸ“…︎ Feb 02 2017
🚨︎ report
Can we get a fix for the "The directory is not empty" error already?

I am constantly getting this error. I am up to date with hackchi, I have tried over and over again many different methods, it takes a whole lot of undoing and redoing to ever get it to work, and I'm at the point that I can't get it to do a darn thing right. Every time I try to add games, I get this error. I'm not doing anything strange, or weird, just trying to add games to my SNES classic. But on both this and my NES classic, I frequently run into this error time and time again. Is there any plan to fix this?

πŸ‘︎ 2
πŸ“°︎ r/nesclassicmods
πŸ’¬︎
πŸ‘€︎ u/JonnyGators
πŸ“…︎ Oct 30 2017
🚨︎ report
rm -rf as root fails: Directory not empty.

I can't find anything online about what to do here. I am trying to forcibly remove the .Trash-1000 folder on an old drive. Actually, I just copied the drive over to my new NAS using rsync on the drive root. Running rm -rf on the drive connected by USB worked fine, but on the cifs-mounted NAS share, the same command fails because a deeply nested directory is not empty:

> [[email protected] cifsmount]# rm -rf ./.Trash-1000/files/DELETE\ IN\ LINUX/debian\ backup\ 6-27-14/Downloads/

>rm: cannot remove β€˜./.Trash-1000/files/DELETE IN LINUX/debian backup 6-27-14/Downloads/’: Directory not empty

I only went down to the directory specifically to try to get rid of it first before running "rm -rf ./.Trash-1000/", but that didn't help either.

Anyone with some more experience than I know what's going on here?

Just throwing this info out there in case it helps: SELinux is disabled on the NAS (Rockstor, BTRFS filesystem) and Permissive on the client I'm running the command from over SSH. A reboot also did nothing.

Edit: It wasn't extra attributes as /u/playaspec speculated, but that's certainly new to me and worth checking into in the future for those who stumble across similar issues.

My step to resolve the issue was to SSH into the NAS/Samba host and rm -rf there, as opposed to doing it on a client as root in the CIFS mount directory like I was previously.

Edit 2: accidentally wrote previous edit in the middle of the post, oops.

πŸ‘︎ 6
πŸ“°︎ r/linuxquestions
πŸ’¬︎
πŸ‘€︎ u/jtaylor991
πŸ“…︎ Oct 18 2015
🚨︎ report
All of my images were deleted after automatically upgrading to 3.0.3 from a pre-3.0.2 version. The /uploads directory is empty. So, all the images in my posts are not displaying. What happened? Why? How do fix?
πŸ‘︎ 3
πŸ“°︎ r/Wordpress
πŸ’¬︎
πŸ‘€︎ u/Clayburn
πŸ“…︎ Dec 15 2010
🚨︎ report
When trying to encrypt my home directory, ecryptfs keeps saying it's not empty.

No matter what I do, ecryptfs will always give an error, citing that my home directory is empty. This happens even if I just made a new user in tty through "useradd -m <NAME>".

This is for the most part, a brand new install. The only changes I have made to the system are installing bleachbit, and installing some updates.

I'm running Debian Testing.

Edit: The problem seems to happen because I'm giving the account a password. Not giving it a password allowed me to proceed. However, when you try to encrypt the home directory of an account without a password, encryptfs complains too. So, I'm not sure what it wants.

Edit 2: You know, all I wanted was to prevent people from accessing my home directory while using the guest account. Changing the permissions on my home directory, to prevent other accounts from reading it basicaly did the same thing. It's not like the people who use the guest account are technologically competent.

πŸ‘︎ 6
πŸ“°︎ r/linux4noobs
πŸ’¬︎
πŸ“…︎ Dec 21 2014
🚨︎ report

Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.