<?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>I cannot create subfolders in FATFS</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/32747/i-cannot-create-subfolders-in-fatfs</link><description>Hi, I&amp;#39;m trying to create subfolders with loop. My partly code looks like: 
 
 
 So, it creates new dir but after that my app is crashing and rebooting, and it works fine if all dirs and subdirs are created (if dirA, dirB, dirC already exist) What I do</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 28 Mar 2018 13:55:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/32747/i-cannot-create-subfolders-in-fatfs" /><item><title>RE: I cannot create subfolders in FATFS</title><link>https://devzone.nordicsemi.com/thread/126330?ContentTypeID=1</link><pubDate>Wed, 28 Mar 2018 13:55:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3199edd-ba3f-4c3b-8db2-58b3f54d6868</guid><dc:creator>Jakub Rzeszutko</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;As I read it is basically not recommended to use strtok function due to some drawbacks. If possible you should use strtok_r.&lt;/p&gt;
&lt;p&gt;One of the drawbacks of strtok is that this function is modyfing its first argument. When you are trying to modify text pointed by char * str, most likely you are trying modify const variable (written in Flash).&lt;/p&gt;
&lt;p&gt;When you will use an array you will not have this problem as string will be in RAM.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I cannot create subfolders in FATFS</title><link>https://devzone.nordicsemi.com/thread/126323?ContentTypeID=1</link><pubDate>Wed, 28 Mar 2018 13:19:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7f02215-9ccb-492a-a8fb-c3e7ce46e70b</guid><dc:creator>IlyaM</dc:creator><description>&lt;p&gt;Jakub, thanks for your reply! Could you please explain why char array should work instead of pointer? Cause printf works fine and I see all my subdirs&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I cannot create subfolders in FATFS</title><link>https://devzone.nordicsemi.com/thread/126319?ContentTypeID=1</link><pubDate>Wed, 28 Mar 2018 12:58:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:812cb331-b304-450a-9da5-c53730e38a61</guid><dc:creator>Jakub Rzeszutko</dc:creator><description>&lt;p&gt;Simply change:&lt;/p&gt;
&lt;p&gt;char *str = &amp;quot;dirA/dirB/dirC/file.txt&amp;quot;;&lt;/p&gt;
&lt;p&gt;to:&lt;/p&gt;
&lt;p&gt;char str[] =&amp;nbsp;&lt;span&gt;&amp;quot;dirA/dirB/dirC/file.txt&amp;quot;;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;and you shall be fine&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I cannot create subfolders in FATFS</title><link>https://devzone.nordicsemi.com/thread/126315?ContentTypeID=1</link><pubDate>Wed, 28 Mar 2018 12:26:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:677a4a0b-ec19-4e47-a57f-ab3d6978e51f</guid><dc:creator>IlyaM</dc:creator><description>&lt;p&gt;Ok, have a nice holidays)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I cannot create subfolders in FATFS</title><link>https://devzone.nordicsemi.com/thread/126314?ContentTypeID=1</link><pubDate>Wed, 28 Mar 2018 12:24:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9012f208-0621-4572-8a2e-6705100f2621</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi IllyaM,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We currently have&amp;nbsp;limited staff due to Easter holidays. We will try to have a look at your case as soon as possible when the team coming back next week.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>