<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>fds_file_delete delete all files with given id?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/24474/fds_file_delete-delete-all-files-with-given-id</link><description>Hi 
 I&amp;#39;m trying to delete all files with a given file id. Will fds_file_delete() delete all files with a given file id, or just the first one it finds? 
 thanks 
 SDK14</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 21 Aug 2017 15:12:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/24474/fds_file_delete-delete-all-files-with-given-id" /><item><title>RE: fds_file_delete delete all files with given id?</title><link>https://devzone.nordicsemi.com/thread/96357?ContentTypeID=1</link><pubDate>Mon, 21 Aug 2017 15:12:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b607a15-f75a-41ab-8055-af7b8453ef9e</guid><dc:creator>q</dc:creator><description>&lt;p&gt;Ah I see where my confusion was.  I was thinking you could have multiple files with the same FILE_ID just as you can have multiple records with the same REC_ID and FILE_ID, but a file is no more than an organizational scheme (whereas records actually hold information).&lt;/p&gt;
&lt;p&gt;Thanks for clarifying!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fds_file_delete delete all files with given id?</title><link>https://devzone.nordicsemi.com/thread/96358?ContentTypeID=1</link><pubDate>Mon, 21 Aug 2017 14:40:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3981b4c-7c81-43d1-b260-43c0c38146d2</guid><dc:creator>RichieJH</dc:creator><description>&lt;p&gt;The documentation is not ambiguous at all.  It is crystal clear.  You do not need to iterate through &lt;code&gt;fds_record_find()&lt;/code&gt; as you are deleting the entire file, not just one record of many with the same FILE_ID &amp;amp; REC_ID as in the case of &lt;code&gt;fds_record_delete()&lt;/code&gt;.  If you notice the &lt;code&gt;fds_record_delete()&lt;/code&gt; you need to pass the &lt;code&gt;&amp;amp;record_desc&lt;/code&gt; and the most efficient way to get this is to perform a search beforehand.  For &lt;code&gt;fds_file_delete()&lt;/code&gt;, you just give it the FILE_ID, and viola all records with that FILE_ID are marked deleted until gc called and then truly deleted thereafter.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fds_file_delete delete all files with given id?</title><link>https://devzone.nordicsemi.com/thread/96359?ContentTypeID=1</link><pubDate>Mon, 21 Aug 2017 13:26:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c1644e9-2980-4c19-bfc7-a19a70028c32</guid><dc:creator>q</dc:creator><description>&lt;p&gt;The documentation is ambiguous.  You can have multiple files with the same file_id, and calling (for example) fds_record_find() can return any one of those files with the provided file_id.  You have to loop through fds_record_find() and fds_record_open() to find/open every file with a given file_id, so it&amp;#39;s plausible one would have to do the same thing with fds_file_delete().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fds_file_delete delete all files with given id?</title><link>https://devzone.nordicsemi.com/thread/96356?ContentTypeID=1</link><pubDate>Sat, 19 Aug 2017 09:13:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b74dcaa-9391-40fe-9b9c-604487e333ae</guid><dc:creator>RichieJH</dc:creator><description>&lt;p&gt;According to the documentation...&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ret_code_t fds_file_delete	(	uint16_t 	file_id	)

Function for deleting all records in a file.

This function deletes a file, including all its records. Deleted records cannot be located using fds_record_find, fds_record_find_by_key, or fds_record_find_in_file. Additionally, they can no longer be opened using fds_record_open.

Note that deleting records does not free the space they occupy in flash memory. To reclaim flash space used by deleted records, call fds_gc to run garbage collection.

This function is asynchronous. Completion is reported through an event that is sent to the registered event handler function.
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>