Code Monkey home page Code Monkey logo

mpw-tools's Introduction

MPW Tools

This is a collection of tools for use with the MPW emulator.

Some of them are replacements for built-in MPW commands. Some of them are replacements (the original Duplicate, for example, has a graphical confirmation box). Some are just handy to use.

These are tested under the MPW emulator. They may or may not actually work with a real MPW installation due to implementation differences.

The tools are:

  • Delete: replacement for the Delete command.

  • Echo: replacement for the Echo command.

  • Duplicate: replacement for the Duplicate command.

  • GetEnv: new command to extract environment variables for use in makefiles.

  • Help: replacement for the Help command. This version looks for individual file in the $MPW:Help: directory rather than searching through a single monolithic help file.

  • ListRez: List the resources in a Macintosh resource file.

  • ListRezIIgs: List the resources in a IIgs resource file.

  • LSegIIgs: List segments in a IIgs OMF File (borrowed from gno/me).

  • MakeEnums: Print struct offsets for various records (for use with MPW development).

  • md5: Print md5 checksum for a file (data and resource fork).

  • OverlayIIgs: replacement for the OverlayIIgs command. (This has been tested under MPW.)

  • Parameters: replacement for the Parameters command.

  • ReadGlobal: Display a global value.

  • SetFile: replacement for the SetFile command. Currently only filetype and creator type are supported.

mpw-tools's People

Contributors

ksherlock avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

mpw-tools's Issues

SetFile -a support

(used in EditCDEV example)

-a attributes

Sets the file attribute bits, where attributes is a string of case-sensitive letters. Each letter corresponds to a file attribute: an uppercase letter indicates that the attribute bit is set (1); a lowercase letter indicates that it is not (0). These are the same attributes that are displayed for files in the -l and -x options of the Files command.

The letters and their "attribute set" meanings are given in the table below. Note that attributes that are not specified in the command line remain unchanged.

  Attribute Meaning when set
A | a Finder alias file.
V | v Invisible. *
B | b Has bundle. *
S | s System file.
T | t Stationery file.
C | c File has custom icon.
O | o File is open.
L | l Write-locked.
I | i Initialized (that is, the Finder is aware of this file and has given it a locationin a window). *
N | n File has no 'INIT' resource.
M | m Shared file (can be launched multiple times).
W | w Always switch launch (if possible).
D | d Located on the desktop. Note that this attribute is not used in System 7. *

* This attribute can also be set for folders.

Note
These attributes are described in the chapter about the File Manager in Inside Macintosh. •

Minor problem of Duplicate -r option

When Duplicate to new file with the -r option, the file type and creater are lost.

$ mpw files -l
Name                             Type Crtr  Size      Last-Mod-Date       Creation-Date  
-------------------------------  ---- ---- ------ ------------------- -------------------
data.only                        AAAA BBBB     4K 11/23/2017  9:07 AM 11/23/2017  9:07 AM
resource.only                    MPST MPS     24K 11/23/2017  9:07 AM 11/23/2017  9:07 AM

$ mpw duplicate -d data.only d-data
$ mpw duplicate -r data.only d-res
Error opening data.only: No such file or directory
$ mpw duplicate -d resource.only r-data
$ mpw duplicate -r resource.only r-res

$ mpw files -l
Name                             Type Crtr  Size      Last-Mod-Date       Creation-Date  
-------------------------------  ---- ---- ------ ------------------- -------------------
r-data                           ???? ????     0K 11/23/2017  1:19 PM 11/23/2017  1:19 PM
r-res                            MPST MPS     24K 11/23/2017  1:19 PM 11/23/2017  1:19 PM
d-res                            AAAA BBBB     0K 11/23/2017  1:19 PM 11/23/2017  1:19 PM
data.only                        AAAA BBBB     4K 11/23/2017  9:07 AM 11/23/2017  9:07 AM
resource.only                    MPST MPS     24K 11/23/2017  9:07 AM 11/23/2017  9:07 AM
d-data                           ???? ????     4K 11/23/2017  1:19 PM 11/23/2017  1:19 PM

$ mpw files -x rb
Name                              Rsrc Sz   Data Sz 
-------------------------------  --------- ---------
r-data                                  0b        0b
r-res                               23945b        0b
d-res                                   0b        0b
data.only                               0b     3376b
resource.only                       23945b        0b
d-data                                  0b     3376b

Original MPW

files -l
Name                  Type Crtr  Size    Flags        Last-Mod-Date       Creation-Date  
--------------------  ---- ---- ------ ---------- ------------------- -------------------
data.only             AAAA BBBB     8K lvbspoImad   23/11/17     9:07   23/11/17     9:07
resource.only         MPST MPS     24K lvbspoImad   23/11/17     9:07   23/11/17     9:07

duplicate -d data.only d-data
duplicate -r data.only d-res
duplicate -d resource.only r-data
duplicate -r resource.only r-res

files -l
Name                  Type Crtr  Size    Flags        Last-Mod-Date       Creation-Date  
--------------------  ---- ---- ------ ---------- ------------------- -------------------
d-data                AAAA BBBB     8K lvbspoimad   23/11/17     9:07   23/11/17     9:07
d-res                 AAAA BBBB     0K lvbspoimad   23/11/17     9:07   23/11/17     9:07
data.only             AAAA BBBB     8K lvbspoImad   23/11/17     9:07   23/11/17     9:07
r-data                MPST MPS      0K lvbspoimad   23/11/17     9:07   23/11/17     9:07
r-res                 MPST MPS     24K lvbspoimad   23/11/17     9:07   23/11/17     9:07
resource.only         MPST MPS     24K lvbspoImad   23/11/17     9:07   23/11/17     9:07

files -x rb
Name                   Rsrc Sz   Data Sz 
--------------------  --------- ---------
d-data                       0b     3376b
d-res                        0b        0b
data.only                    0b     3376b
r-data                       0b        0b
r-res                    23945b        0b
resource.only            23945b        0b

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.