<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/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/"><channel><title>RL-FlashFS: How to determine the length of a file</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/27037/rl-flashfs-how-to-determine-the-length-of-a-file</link><description> 
Hi all, 

 
when I try to determine the lenhth of a file I use following
code: 

 
int flength(char *filename)
{
FILE* file;
FINFO info;

 file = fopen(filename,&amp;quot;r&amp;quot;);
 if(!file)
 {
 return(-1);
 }
 fclose(file);

 info.fileID = 0;
 while(ffind(filename</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: RL-FlashFS: How to determine the length of a file</title><link>https://community.arm.com/thread/126062?ContentTypeID=1</link><pubDate>Mon, 29 Mar 2010 03:03:05 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:444841b8-b38d-4083-8e84-1efd7793ce17</guid><dc:creator>Tamir Michael</dc:creator><description>&lt;p&gt;&lt;p&gt;
As far as I understand, ffind work just like the proposed solution
that &amp;quot;works&amp;quot;. Your fopen might still failed unless you follow the
naming conventions of Flash-FS.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RL-FlashFS: How to determine the length of a file</title><link>https://community.arm.com/thread/115628?ContentTypeID=1</link><pubDate>Mon, 29 Mar 2010 02:53:19 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c05202e1-d2c9-457d-b522-ad164bdb84fd</guid><dc:creator>Marco Becker</dc:creator><description>&lt;p&gt;&lt;p&gt;
Thanks Thorsten,&lt;/p&gt;

&lt;p&gt;
fseek/ftell works fine!&lt;/p&gt;

&lt;p&gt;
For now my problem is solved, though I still don&amp;#39;t understand why
ffind() won&amp;#39;t work....&lt;/p&gt;

&lt;p&gt;
Thanks for sharing,&lt;br /&gt;
Marco&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RL-FlashFS: How to determine the length of a file</title><link>https://community.arm.com/thread/103860?ContentTypeID=1</link><pubDate>Mon, 29 Mar 2010 01:53:45 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:69887f40-0239-49aa-9986-9b474bbc3e93</guid><dc:creator>Thorsten de Buhr</dc:creator><description>&lt;p&gt;&lt;p&gt;
ok, not exactly the answer to your text but an answer to the
question :-)&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RL-FlashFS: How to determine the length of a file</title><link>https://community.arm.com/thread/90322?ContentTypeID=1</link><pubDate>Mon, 29 Mar 2010 01:44:23 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:4a57ab08-d9ab-4ddc-8b77-759fb5eb2d06</guid><dc:creator>Thorsten de Buhr</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hi,&lt;/p&gt;

&lt;p&gt;
stdio gives:&lt;/p&gt;

&lt;pre&gt;
fseek(fp, 0, SEEK_END);
fileSize = ftell(fp);
&lt;/pre&gt;

&lt;p&gt;
&lt;a href="http://www.keil.com/support/man/docs/rlarm/rlarm_fs_func_fileio.htm"&gt;
&lt;a href="http://www.keil.com/support/man/docs/rlarm/rlarm_fs_func_fileio.htm"&gt;www.keil.com/.../rlarm_fs_func_fileio.htm&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
BR,&lt;br /&gt;
/th.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RL-FlashFS: How to determine the length of a file</title><link>https://community.arm.com/thread/57972?ContentTypeID=1</link><pubDate>Mon, 29 Mar 2010 01:22:44 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c60a5a38-46ee-40a1-9db5-25f06bd217f2</guid><dc:creator>Tamir Michael</dc:creator><description>&lt;p&gt;&lt;p&gt;
Flash-FS rules for file names are rather confusing.&lt;br /&gt;
This is what I once got from Keil support:&lt;/p&gt;

&lt;p&gt;
&amp;quot;&lt;i&gt;The filename case handling was described by the developers
like that:&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;- if name is less than or equal 8 characters and extension less
or equal to 3 and only one case characters, (all lower or all upper)
file is coded as short filename which only contains upper cases
letters so:&lt;br /&gt;
test.txt =&amp;gt; TEST.TXT&lt;br /&gt;
TEST.TXT =&amp;gt; TEST.TXT&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;- if case of letters are mixed it is automatically considered a
long filename and filename is encoded as it was written Test.txt
=&amp;gt; Test.txt teSt.txt =&amp;gt; teSt.txt&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;- if there are more than 8 characters in filename or more than
3 in extension or more . (dots) in filename it is encoded as long
filename&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;- filename Test.txt is different than filename tEst.txt as they
are both long and encoded as they were written&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
&amp;quot;&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>