AppleII-LibA2
view release on metacpan or search on metacpan
lib/AppleII/ProDOS.pm view on Meta::CPAN
representing the new subdirectory entry.
=item $entry = $dir->open_dir($dirname)
Opens a subdirectory of the directory. C<$dirname> may be either a
subdirectory name or an C<AppleII::ProDOS::DirEntry> object. Returns
a new C<AppleII::ProDOS::Directory> object.
=item $dir->put_file($file)
Stores a file in the directory. C<$file> must be an
C<AppleII::ProDOS::File> object.
=item $dir->add_entry($entry)
Adds a new entry to the directory. C<$entry> is an
C<AppleII::ProDOS::DirEntry> object.
=item $dir->read_disk
Rereads the directory contents from the image file. You can use this
to undo changes to a directory before they have been written to the
image file.
=item $dir->write_disk
Writes the current directory contents to the image file. You must use
this if you alter the directory contents in any way except the
high-level methods C<new_dir> and C<put_file>, which do this
automatically.
=back
=head2 C<AppleII::ProDOS::DirEntry>
C<AppleII::ProDOS::DirEntry> provides access to directory entries.
It provides the following methods:
=over 4
=item $entry = AppleII::ProDOS::DirEntry->new([$num, $entry])
Constructs a new C<AppleII::ProDOS::DirEntry> object.
C<$num> is the entry number in the directory, and C<$entry> is the
packed directory entry. If C<$num> and C<$entry> are omitted, then a
blank directory entry is created. This is a low-level function; you
shouldn't need to explicitly construct DirEntry objects.
=item $packed_entry = $entry->packed($key_block)
Return the directory entry in packed format. C<$key_block> is the
starting block number of the directory containing this entry.
=item $access = $entry->access([$new])
Gets or sets the access attributes. This is a bitfield with the
following entries:
0x80 File can be deleted
0x40 File can be renamed
0x20 File has changed since last backup
0x02 File can be written to
0x01 File can be read
Normal values are 0xC3 or 0xE3 for an unlocked file, and 0x01 for a
locked file.
=item $auxtype = $entry->auxtype([$new])
Gets or sets the auxiliary type. This is a number between 0x0000 and
0xFFFF. Its meaning depends on the filetype.
=item $creation_date = $entry->created([$date])
Gets or sets the creation date and time in ProDOS format.
=item $modification_date = $entry->modified([$date])
Gets or sets the modification date and time in ProDOS format.
=item $name = $entry->name([$new])
Gets or sets the filename.
=item $type = $entry->type([$new])
Gets or sets the filetype. This is a number between 0x00 and 0xFF.
Use C<parse_type> to convert it to a more meaningful abbreviation.
=item $type = $entry->short_type
Returns the standard abbreviation for the filetype. It is equivalent
to calling C<AppleII::ProDOS::parse_type($entry-E<gt>type)>.
=back
The following methods allow access to read-only fields. They can be
used to initialize a DirEntry object created with C<new>, but raise an
exception if the field already has a value.
=over 4
=item $block = $entry->block([$new])
Gets or sets the key block for the file.
=item $used = $entry->blks_used([$new])
Gets or sets the number of blocks used by the file.
=item $entry_num = $entry->num([$new])
Gets or sets the entry number in the directory.
=item $size = $entry->size([$new])
Gets or sets the size of the file in bytes.
=item $storage = $entry->storage([$new])
Gets or sets the storage type.
( run in 1.035 second using v1.01-cache-2.11-cpan-39bf76dae61 )