Command Line

This sample demonstrates a simple app running inside a sandbox that prints information about files or directories specified from the command line. It has an adef with an executables section, and cdef with sources section.

Go to the sample app code.

Run this to install the sample app:

$ cd apps/sample/commandLine
$ make wp85
$ instapp fileInfo.wp85.update <ip address>

If you're using an AR7 module in your target, substitute ar7 for wp85.

This sample app takes a command with a list of file/directory paths, and accepts additional options like -x or --max-count.

Here's an example on how to run the command-line sample app:

Start your Legato app app start <appname>.

Change to the sandbox directory:

cd /tmp/legato/sandboxes/<appname>/bin

This is how to access a regular file:

root@swi-mdm9x15:/tmp/legato/sandboxes/fileInfo/bin# ./fileInfo type /etc/hosts --max-count=10

This is how to access permissions to control read/write, group members' and others' read access.

root@swi-mdm9x15:/tmp/legato/sandboxes/fileInfo/bin# ./fileInfo permissions /etc/hosts --max-count=10

Start App

See
Create Apps