01-22-2015 01:03 PM
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.
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 ?
Solved! Go to Solution.
01-23-2015 04:13 AM
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 ?
01-23-2015 07:03 AM
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
01-23-2015 07:47 AM - edited 01-23-2015 07:49 AM
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.