Community
cancel
Showing results for 
Search instead for 
Did you mean: 
SVald
Beginner
1,283 Views

Intel Edison Log Data in HDD

Hi!

 

I am trying to do a websocket application that stores data on the hdd of the intel edison.

 

I was able to understand how to manage websockets with the example inside intel xdk

Now my question is...how can i write a file.txt in the hdd? (the 1gb that appears as a hard disk when you connect the edison)

I tried to use fs.writeFileSync('data.txt', data..... but i have no idea where it is generating the txt! or how can I access it!

I want to have access to the file.txt through my application (read/write file) and through windows explorer

I am not sure if a solution is to copy the project inside the edison hdd and somehow run it.

Thank you in advance!

3 Replies
Pedro_M_Intel
Employee
77 Views

Hello katsu07,

Exactly what do you want to have in this file? Do you want to create it within the Edison's file system or do you want to have it in the Edison's drive (the one that you see in Windows Explorer as X:).

If you want to create this file in the Edison's file system, then it's pretty simple, you will have to add a system call on your code that includes the command: echo Your_Message >> /home/root/your_file.txt. This way you will be able to add text lines to a file or create it if it doesn't exist.

How to do a system call will vary on which language you are using, since you mentioned the XDK, then I'm guessing that you are using Node.JS, in that case I suggest you to check this thread: Taimoor makes an example of how to use https://nodejs.org/api/child_process.html# child_process_example_sending_server_object Child Process, that's used in Node to add system calls to your code.

Peter.

SVald
Beginner
77 Views

Hi Peter

 

I want to store in the Edison drive, so how can I do this?

 

It is a simple txt file, and yes I am using node

Btw thank you for your fast answer

Pedro_M_Intel
Employee
77 Views

I see, the approach shouldn't be that different, however you will have to mount the Edison's drive from Linux first, I suggest you to check this thread: .

Peter.

Reply