IPC@CHIP® RTOS-LNX – API Documentation

Header image

Main page



EDIT [filename]: Edit a text file
This command provides a simple text editor.
Example:
edit chip.ini
Since
V1.05


CD directory: Change the current working directory
Changes the current working directory in the command shell.
Example:
cd temp
Since
V0.80


COPY filename1 filename2: Copy a file
Copy a file. The two file specifiers must be complete file names. Wildcards such as * or ? are not allowed.

This command will fail if the resulting overall full path length of the new file exceeds a maximum (see below). This full path includes the drive letter and back slashes in the count, e.g.:
A:\TEMP\MY_FILE.TXT
Each of the string length specifications here do not include in the count the required final string terminating NIL character.

The over all maximum path length is 259 characters. The names in each segment of the full path are limited to 255 characters maximum.
Example:
cd temp
Since
V0.80


DEL filename: Delete a file
Delete a file or all files that match the wildcard.

Files which have the Read-only attribute set cannot be deleted.
Example:
del myFile.dat
Since
V0.80
Related:
DIR command


DIR filename: List a direcory
List the directory entry or all entries that match the wildcard.

If no argument is given, *.* is assumed.

The file's attributes are shown with three letter designations. The letter is replaced by a dash, '-', when the respective attribute is not set.
Currently only one attribute is supported.
This attribute is:
  • R - Read-only file
The read-only attribute will prevent files from being deleted so long as this flag is set.

Note that C language applications can control these attribute flags with the _dos_setfileattr() standard C-library function.

The short 8.3 alias name will no longer be supported.
Example:
 dir *.exe
 DIR *.txt
 dir B:
Since
V0.80
Related:
DEL command


MD directory: Creates a direcotory
Creates a subdirectory.

This command will fail if the resulting overall full path length exceeds a maximum (see below). This full path includes the drive letter and back slashes in the count, e.g.:

     A:\TEMP\

Each of the string length specifications here do not include in the count the required final string terminating NIL character.

The over all maximum path length is 259 characters.
Example:
md temp
Since
V0.80


RD directory: Removes a directory
Removes a directory. This command cannot be executed on directories containing data.
Example:
rd temp
Since
V0.80


REN oldpath newname [-f]: Rename a file/directory
Rename a file or directory specified by 'oldpath' to 'newname'.

Wildcards such as * or ? are not allowed in either of the file names. The command fails after no operation if a file or directory at the 'newname' already exists.

Files or directories which are in use by a task or program cannot be renamed or moved.

This command's functionality can be reached from within a program using the rename() standard C-Library function.

Files can be moved to another directory on the same drive by specifying a path with the new name. When no path is specified for the new name, the file or directory is given the new name at its existing location.

Similarly, directories can be moved provided that the destination is not a directory nested inside the directory that is being moved. (Such a move would not make any sense.) The new directory name can optionally be different from the original name.

The path that a file or directory is moved to must already exists. No new directories are created by REN along the way.

Before performing a directory move, the file system checks to assure that no file or directory will end up with a name which exceeds the 259 character limit on path string lengths. The REN operation fails with no operation performed if such a path name would result.

Note that a file or directory move operation is implemented without moving any actual disk data clusters. Only some directory node entries are edited, making the action more efficient than would be a file copy and deleting the old file(s) sequence.

When there are open files within a moved directory or its subdirectories, these files remain open and operational after the move.

If a task's current working directory is within subdirectories of a directory which is moved, then following this directory move, that task's current working directory will also have moved. For example, in the following experiment the console task's current working directory change from B:\Dir1\Subdir1 to B:\Dir2\MovedDir1\Subdir1 can be observed as a result of the directory move by REN.

The -f (force) option can be used to skip the check whether the destination file already exists. If the -f option is not given and the destination file already exists, the rename operation will not be performed and an error message will be printed.
   B:\>md Dir1
   B:\>md Dir2
   B:\>cd Dir1
   B:\Dir1\>md Subdir1
   B:\Dir1\>cd Subdir1
   B:\Dir1\Subdir1\>REN \Dir1 \Dir2\MovedDir1
   Renamed \Dir1 to \Dir2\MovedDir1
   B:\Dir2\MovedDir1\Subdir1\>
 
Examples:
    ... Simply rename a file
   REN  A:\subdir\readme.txt  newname.txt
     ... Move a file (you could also rename it here)
   REN  B:\Dir1\readme.txt  B:\Dir2\otherDir\readme.txt
     ... Move a directory named 'otherDir'
   REN  B:\Dir1\otherDir  B:\Dir2\otherDir
     ... Move and rename the directory 'otherDir' to 'movedDir'.
   REN  B:\Dir1\otherDir  B:\Dir2\movedDir
Since
V0.80


FORMAT drive [/F:type] [R:/n] [C:/n]: Formats a drive
Formats the given drive.

ATTENTION: All information on the drive will be lost!

Make sure that other tasks do not access the drive when formatting.

Command Line Options:
  • /F:type - Where 'type' is the file system type. The following file system types are possible:
    • 'vfat' (FAT file system, chooses FAT12/16/32 automatically)
    • '12' (FAT file system, FAT12)
    • '16' (FAT file system, FAT16)
    • '32' (FAT file system, FAT32)
    • 'ext2' (Linux ext2 file system)
    • 'ext3' (Linux ext3 file system)
    • 'ext4' (Linux ext4 file system)
  • /R:n - For FAT12 or FAT16 file system only. Specifies 'n' root directory entries. Will be rounded to next fitting number.
  • /C:n - For FAT file system only. Specifies 'n' sectors per cluster. Must be a power of 2, i.e. 1, 2, 4, 8, ... 128.
Comments:
The command line options can only be given if the external drives B: or D: are formatted. They are not valid for the internal drive A:.
If the /F option is not given, the file system already present on the drive will be used for formatting. If no valid file system is found, 'vfat' will be used.
Keep in mind that the Linux ext file systems use case-sensitive file names, in contrast to the FAT file systems where file names are case-insensitive.
Example:
format A:
format B: /F:ext4
Since
V0.86
Changes:
V1.12 - Add the /F, /R and /C parameters


CHKDSK drive [/F]: Check disk integrity
This command checks a specified disk and displays a status report. The command line option /F can be used to repair certain types of faults detected on the drive.

Currently, only FAT and ext formatted drives can be checked. This excludes the internal drive A: on the SC1x5, which uses UBIFS.
Example:
chkdsk B:
Since
V0.86


TYPE filename: Type a file
Show contents of a file on the console.
Example:
type CHIP.INI
Since
V0.80


RAMDRIVE size: Create a RAM drive C:
Create a RAM drive C: with given size in kbytes.

This command is helpful if you want to create an RAM drive on the fly. If your application always needs an RAM drive, you can setup the RAM drive in the CHIP.INI.
Example:
ramdrive 256
Since
V1.08


FSCLEAN drive: Clean up drive
Cleanup the drive from special hidden files.

This command can be used to delete special hidden files from the drive. In case a running executable is deleted, the associated file name is freed, but the content of the file is preserved and still accessible via a hidden file. The deleted executable now has a new hidden file name. If the executable terminates this hidden file is finally deleted. However, if the system is reset when this executable is still running, the hidden file is not deleted and occupies space inside the file system. This command can be used to get rid of such files.

Currently, this command is only needed and supported for drive A:.
Example:
fsclean A:
Since
V1.11





Top of page | Main page

Copyright © 2018 Beck IPC GmbH
Generated on Fri Jun 8 2018 12:48:20 by Doxygen 1.8.13