From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Linux RT - Copy file from disk to usb key

Solved!
Go to solution

Hi migrating my code from a VxWorks target to a Linux RT target (9068), I'm having problems running a piece of code which copies files from cRIO disk to a usb key !

This code perfectly works under my VxWorks (and even Pharlaps targets). See attached VI.

CopyFiles.png

Some files (100k.txt ; 1M.txt, ...) are present in the tmp folder of my 9068 disk. And I'd like to transfer them on my USB key (U drive).

Both folder exists when the code runs (checked with my WebDAV client).

When executed, the copy function returns 'error 8' : permission error.

So I tried to check what was my permission on U folder : 511. I tried to modify the permission to 700 : error 8 !

I then checked 'who I am' => lvuser. I then connected to my cRIO webpage => user permissions => I added rights 'FSRead' and 'FSWrite' to my lvuser. The reboot the target. => Copying files still returns error 8 !

However, it looks like I can create and write a file in the U folder.... I can read files placed in the U folder.... but not copy ??!!??

 

What happens ? Can somebody tell me how to copy files from my cRIO disk to my USB key ? Why is that complicated to do such basic things ?

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 1 of 4
(5,694 Views)

Ok, I found where the error comes from.

For testing purpose I created the source files (/tmp/FileSource) using my WebDAV client (BitKinex). This client was connecting the cRIO as admin.

Then, I found out that running a VI is done as 'lvuser' user. And it looks like that lvuser cannot act on files created by an admin user...

 

Connecting my cRIO as lvuser with the webDAV client, placing the files in the /tmp/FileSource folder, and copy them (by code) under /U folder then works fine...

 

Is there a document somewhere on the NI's website which explains rights mecanism for cRIOs under Linux ?

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 2 of 4
(5,677 Views)

Hi,

 

Did you tried to do the same thing on the following path : /home/lvuser

I've found two documents that talk about path and permissions files.

 

http://www.ni.com/tutorial/14669/en/

http://digital.ni.com/public.nsf/allkb/4EBE45E8A816B19386257B6C0071D025?OpenDocument

 

Be carrefull, the content of /tmp will be deleted after you restart the target.

 

Have a great day

 

Paolo_P
Certified TestStand Architect
Certified LabVIEW Architect
National Instruments France

0 Kudos
Message 3 of 4
(5,671 Views)
Solution
Accepted by topic author CyGa

Hi Paolo,

 

As described in my second post, tmp folder isn't the problem.

I've written to /C or even in /home/lvuser... Didn't change anything.

It just seems that the problem came from the fact that a lvuser (default user when running lv code) cannot basically 'touch' files created/modified by an admin...

 

In the first link you posted, at the end of document, it's written :

 

"File and folder access permissions are not enforced on NI Real-Time targets running VxWorks or PharLap operating systems.  NI Linux Real-Time targets, on the other hand, use and enforce standard Linux style file and folder access permissions."

 

As I'm not very familiar with Linux environement, I could be nice to have more details on this standard linux style access permissions.

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 4 of 4
(5,667 Views)