/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / Write new line to text file

Username:     
Password:     
             

Forum

# 1   2010-10-06 10:31:28 Write new line to text file

jkwool
New member
Registered: 2010-07-16
Posts: 3

Write new line to text file

Hi,

This is a really basic question but how do i write a new line to a text file so the next write will be on the next line?

I have tried a couple of different things but none of them seem to work.

FS_WriteFile (&file_info, (u8 *)"test", &write_length, 4);
FS_WriteFile (&file_info, "\n", &write_length, 2);


I also tried writing the ansi number for a Carriage return 0xD but that did not seem to work either?

Offline

 

# 2   2010-10-06 13:01:26 Write new line to text file

far-far
Member
Registered: 2010-05-28
Posts: 10

Re: Write new line to text file

Offline

 

# 3   2010-10-06 22:12:22 Write new line to text file

jkwool
New member
Registered: 2010-07-16
Posts: 3

Re: Write new line to text file

Ok thanks for your reply, I have read up on what it mean to have a 32-bit aligned buffer, how do i do it in code for the circle os?

Offline

 

# 4   2010-10-07 12:28:03 Write new line to text file

far-far
Member
Registered: 2010-05-28
Posts: 10

Re: Write new line to text file

union TUnionTag
{
    u8                Buf[BUF_SIZE];
    unsigned int  i; // force 32-bit int alignment
} u;

FS_WriteFile(u.Buf, ........

Offline

 

Board footer