# adding the ignore condition, only files can be deleted, but folders cannot be deleted?

**URL:** https://forum.syncthing.net/t/adding-the-ignore-condition-only-files-can-be-deleted-but-folders-cannot-be-deleted/18305
**Category:** Support
**Created:** [April 14, 2022, 8:04am UTC](https://forum.syncthing.net/t/adding-the-ignore-condition-only-files-can-be-deleted-but-folders-cannot-be-deleted/18305 "2022-04-14T08:04:29Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![shumintao](https://forum.syncthing.net/user_avatar/forum.syncthing.net/shumintao/32/11756_2.png) [@shumintao](https://forum.syncthing.net/u/shumintao)
#### Post date: [April 14, 2022, 8:04am UTC](https://forum.syncthing.net/t/adding-the-ignore-condition-only-files-can-be-deleted-but-folders-cannot-be-deleted/18305/1 "2022-04-14T08:04:29Z")

</div>

- . stignore

```
!D/**/Info/ExperimentInfo.txt
*

```

- macos

```
(base) ╭─facebook at FaceBook的MacBook Pro in ~/Sync using 
╰─○ ls
D ExperimentInfo.txt
(base) ╭─facebook at FaceBook的MacBook Pro in ~/Sync using 
╰─○ rm -rf D 

```

- other

```
[edge@gs-server-11051 kmci3-tuqhj]$ tree
.
└── D
    └── csv222
        └── Info

```

Only deleted the Experiment Info.txt file, the D folder was not deleted …

---

<div class="post-metadata">

### Author: ![tomasz86](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/t/96bed5/32.png) [@tomasz86](https://forum.syncthing.net/u/tomasz86)
#### Post date: [April 14, 2022, 8:09am UTC](https://forum.syncthing.net/t/adding-the-ignore-condition-only-files-can-be-deleted-but-folders-cannot-be-deleted/18305/2 "2022-04-14T08:09:00Z")

</div>

Please be more specific and describe in details what you actually desire to do. It may be just me, but all the funky characters don’t really help either 😉.

Screenshots may better display what you’re trying to do, so if you can, please show how the situation looks in the Syncthing Web GUI, including the ignore patterns.

---

<div class="post-metadata">

### Author: ![shumintao](https://forum.syncthing.net/user_avatar/forum.syncthing.net/shumintao/32/11756_2.png) [@shumintao](https://forum.syncthing.net/u/shumintao)
#### Post date: [April 14, 2022, 8:30am UTC](https://forum.syncthing.net/t/adding-the-ignore-condition-only-files-can-be-deleted-but-folders-cannot-be-deleted/18305/4 "2022-04-14T08:30:00Z")

</div>

- macos

 ![image](https://forum-uploads.syncthingcdn.net/original/2X/9/98f90947acf83ea765c6bb427126e6eff28b969f.png)

 ![image](https://forum-uploads.syncthingcdn.net/original/2X/7/7b6e3cf18a215e6527423edc447282e08f7c722d.jpeg)

- edge

 ![image](https://forum-uploads.syncthingcdn.net/original/2X/d/d746b87da51914c70624f9bd104fb6eda45e4ae5.png)

 ![image](https://forum-uploads.syncthingcdn.net/original/2X/f/f59e607566dc25dcc7d270b09f5410465bdcd82c.jpeg)

want:

I hope that when the D folder is deleted on macOS, edge can also delete the D folder. Now just delete the file, not delete the folder

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [April 14, 2022, 9:42am UTC](https://forum.syncthing.net/t/adding-the-ignore-condition-only-files-can-be-deleted-but-folders-cannot-be-deleted/18305/5 "2022-04-14T09:42:57Z")

</div>

Only the file is “not ignored”, all the folders under it are technically ignored, hence are not touched, even if not needed.

---

<div class="post-metadata">

### Author: ![tomasz86](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/t/96bed5/32.png) [@tomasz86](https://forum.syncthing.net/u/tomasz86)
#### Post date: [April 14, 2022, 11:38am UTC](https://forum.syncthing.net/t/adding-the-ignore-condition-only-files-can-be-deleted-but-folders-cannot-be-deleted/18305/6 "2022-04-14T11:38:31Z")

</div>

Very ugly, but this should do the job. Tested locally, and the whole tree does get deleted this way.

```
!D/**/Info/ExperimentInfo.txt
(?d)D/**/
!D/**
(?d)D/
!D
(?d)*

```

---

<div class="post-metadata">

### Author: ![shumintao](https://forum.syncthing.net/user_avatar/forum.syncthing.net/shumintao/32/11756_2.png) [@shumintao](https://forum.syncthing.net/u/shumintao)
#### Post date: [April 15, 2022, 1:21am UTC](https://forum.syncthing.net/t/adding-the-ignore-condition-only-files-can-be-deleted-but-folders-cannot-be-deleted/18305/7 "2022-04-15T01:21:49Z")

</div>

Thank you so much for your help, you really helped me out with a big problem

---

<div class="post-metadata">

### Author: ![system](https://forum-uploads.syncthingcdn.net/original/2X/0/0b50e0a202b22ae6a67190759e8c868805b8ed9f.png) [@system](https://forum.syncthing.net/u/system)
#### Post date: [May 15, 2022, 1:22am UTC](https://forum.syncthing.net/t/adding-the-ignore-condition-only-files-can-be-deleted-but-folders-cannot-be-deleted/18305/8 "2022-05-15T01:22:34Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
