# \[F\] Export | One file per directory overwrite

**URL:** https://community.mp3tag.de/t/f-export-one-file-per-directory-overwrite/5601
**Category:** Fixed Bugs
**Tags:** bug-fixed
**Created:** [October 15, 2007, 9:42pm UTC](https://community.mp3tag.de/t/f-export-one-file-per-directory-overwrite/5601 "2007-10-15T21:42:10Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [October 15, 2007, 9:42pm UTC](https://community.mp3tag.de/t/f-export-one-file-per-directory-overwrite/5601/1 "2007-10-15T21:42:10Z")

</div>

Using 'One file per directory' to get one file per directory works fine provided the output lines are in directory order... but if they are not, each directory's file contains the output of only the last group of files in that directory. It seems upon each directory change mp3tag is opening that output file as empty, erasing any existing content, whereas each time except the first it should be opening for appending.

A workaround is to surround the export config file content with

$loop(%\_folderpath%)  
$loopend()

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [October 25, 2007, 6:08pm UTC](https://community.mp3tag.de/t/f-export-one-file-per-directory-overwrite/5601/2 "2007-10-25T18:08:15Z")

</div>

I've marked this report as "No Bug".

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [October 27, 2007, 2:04pm UTC](https://community.mp3tag.de/t/f-export-one-file-per-directory-overwrite/5601/3 "2007-10-27T14:04:47Z")

</div>

I'd be interested to know why.

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [October 28, 2007, 8:15pm UTC](https://community.mp3tag.de/t/f-export-one-file-per-directory-overwrite/5601/4 "2007-10-28T20:15:32Z")

</div>

Because you only need to to sort your files by directory to get the result you want to achieve.

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [November 14, 2007, 2:14pm UTC](https://community.mp3tag.de/t/f-export-one-file-per-directory-overwrite/5601/5 "2007-11-14T14:14:40Z")

</div>

That makes it a bug with a workaround - not "no bug"!

And since the bug can cause secret data loss, I suggest it is worth fixing.

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [November 17, 2007, 11:48am UTC](https://community.mp3tag.de/t/f-export-one-file-per-directory-overwrite/5601/6 "2007-11-17T11:48:59Z")

</div>

I've though about this again and I think I see your point now. What you expect is that the Export creates one file of per directory regardless how the file list is sorted. I'll look into this again, but it won't append the results to an existing file (unless you enable the append option).

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [November 17, 2007, 6:52pm UTC](https://community.mp3tag.de/t/f-export-one-file-per-directory-overwrite/5601/7 "2007-11-17T18:52:20Z")

</div>

With the current [Development Build](http://developer.mp3tag.de), the Export doesn't depend on the order of the file list anymore.

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [February 6, 2008, 7:55pm UTC](https://community.mp3tag.de/t/f-export-one-file-per-directory-overwrite/5601/8 "2008-02-06T19:55:33Z")

</div>

> I've though about this again and I think I see your point  
> now. What you expect is that the Export creates one file  
> of per directory regardless

Exactly.

> I'll look into this again,

Thanks for the fix! Confirmed in V2.39n.

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [December 28, 2018, 1:57pm UTC](https://community.mp3tag.de/t/f-export-one-file-per-directory-overwrite/5601/9 "2018-12-28T13:57:25Z")

</div>

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