LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

File Permissions Error when trying to copy files from and to USB in linux RTOS on sbRIO-9607

Solved!
Go to solution

Hello,

 

I am trying to copy files to a USB drive using my RT program, however I am getting File permissions error.

I checked the permissions of USB Drive using get permissions function, I got 755 as the permissions, indicating rwx (read, write, execute) permissions for admin, and rx permissions for users and others. 

 

I tried to set permissions so that I can have rwx permissions for admin and users, I get File permissions error. 

 

I tried chmod command with 777 as an input to change file permissions to systemexec function. Still no use.

 

Does anyone know how to solve this? I just want to copy files to USB drive using my RT Application

Download All
0 Kudos
Message 1 of 3
(1,890 Views)

Are you logged into the RTOS as an Administrator?

 

Why not write the files to the sbRIO itself, and then use an FTP protocol from a connected Host to copy the files from the sbRIO's disk to the Host?  If your sbRIO program is running as the "Target" of a LabVIEW Real-Time Application (with a Host part running on a PC), you can use Network Streams or other protocols to send the data to the Host as part of your Application, and the Host can write it out whereever you program it.

 

Bob Schor

0 Kudos
Message 2 of 3
(1,812 Views)
Solution
Accepted by topic author Vinay28101988

Thanks for the reply,

 

I am logging all my data locally.

 

I have a requirement to transfer files to USB once my test is completed. I was stuck at this point as I was getting file permissions error and the lvuser account from which the RT application runs did not have permissions to write to USB.

 

I had to do a small modification in /etc/fstab file for the same. I had to add the below line at the end of the file

"/dev/sda1 /media/sda1 auto users,umask=000 0 0"

The umask=000 variable provides permissions to all users to read and write to USB Drive.

 

With this modification and using "cp -R source_directory destination_directory" command from systemexec.vi I was able to copy my files to USB.

0 Kudos
Message 3 of 3
(1,804 Views)