CPMCHMOD

Section: User commands (1)
Updated: December 1, 2013

Index   Return to Main Contents   Disclaimer  


  NAME cpmchmod - change file mode on CP/M files.

  SYNOPSIS

cpmchmod [-f format] image mode file-pattern ...

Note: Wildcards like *.com should be preceded with the user number using a pattern like 0:*.com.

  DESCRIPTION

Cpmchmod changes the file mode for files on CP/M disks.

  OPTIONS

-f
Use the given CP/M disk format instead of the default format.

mode Octal file mode, as used in the unix command chmod.

Numeric (Octal) file mode:

From one to four octal digits. Any omitted digits are assumed to be leading zeros.

chmod Examples:

chmod 400 file - Read by owner
chmod 040 file - Read by group
chmod 004 file - Read by world

chmod 200 file - Write by owner
chmod 020 file - Write by group
chmod 002 file - Write by world

chmod 100 file - execute by owner
chmod 010 file - execute by group
chmod 001 file - execute by world

To combine these, just add the numbers together:

chmod 444 file - Allow read permission to owner and group and world
chmod 777 file - Allow everyone to read, write, and execute file

cmpchmod Examples:

The following example shows how to change a file on an Apple II DOS 3.3 order cpm disk image to read only:

cpmchmod -f apple-do exmplcpm.dsk 444 bhead.c

The following example shows how to change a file on an Apple II DOS 3.3 order cpm disk image to read/write:

cpmchmod -f apple-do exmplcpm.dsk 666 bhead.c

  RETURN VALUE - Upon successful completion, exit code 0 is returned.

This will likely only be of interest to programmers. In a Win32 system the exit code can be trapped in a batch file as an "ERRORLEVEL" or as a return value when run from another Win32 console program written in a language like C.

  ERRORS - Any errors are indicated by exit code 1.

This will likely only be of interest to programmers. In a Win32 system the exit code can be trapped in a batch file as an "ERRORLEVEL" or as a return value when run from another Win32 console program written in a language like C.

  FILES - diskdefs - CP/M disk format definitions

The diskdefs file is a plain ascii text file (in "unix" format, not Windows format) that serves as a database of disk and disk image format definitions. It can be reviewed for available CP/M formats and their names. For Apple II CP/M 80 users the disk image formats apple-do and apple-po are available.
To convert between Windows text and "unix" text, two utilities (rmcr and cr) are included in the Windows distro of the cpmtools binaries. These are included so you can use a Windows text editor to edit a copy of diskdefs if your Windows text editor does not edit "unix" text.

The possible locations where cpmtools first looks for the diskdefs file:

Can vary depending on the preferences of the person who builds the cpmtools binaries (executables) from the source code.

If it's not found the current (work) directory is then searched for a file called diskdefs.

The Windows distro uses \cpmtools\diskdefs as a default.

On a unix-like system, a ${prefix}/share/ style path like /usr/local/share/ is a possible place that cpmtools will first look for diskdefs.

In a Win32 system sometimes unix-like shells like cygwin are used to build and run cpmtools instead of Windows cmd. For those installations unix-like conventions may apply.

  AUTHORS

This program is copyright 1997-2013 Michael Haardt <michael@moria.de> and copyright 2000, 2001, 2011 John Elliott <jce@seasip.demon.co.uk>.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

  SEE ALSO

cmpls(1), cpm(5)


 Index

NAME cpmchmod - change file mode on CP/M files.
SYNOPSIS
DESCRIPTION
OPTIONS
RETURN VALUE
ERRORS
FILES
AUTHORS
SEE ALSO

Caveat Emptor

The contents of this document are either part of cpmtools or provide additional information about using cmptools. You can redistribute it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

Bill Buckels has no warranty obligations or liability resulting from this document's use in any way whatsoever. If you don't agree then don't read it.