Extract block from or replace a block on an amigaDisk object
Source:R/03amigaBlockBasics.r
amigaBlock-method.Rd
Extract an amigaBlock
from an amigaDisk
object,
or replace it on the disk.
Usage
# S4 method for class 'amigaDisk,numeric'
amigaBlock(x, block)
# S4 method for class 'amigaDisk,numeric,amigaBlock'
amigaBlock(x, block) <- value
Arguments
- x
An
amigaDisk
object from which the block needs to be extracted or on which the block needs to be replaced.- block
A
numeric
identifier (whole numbers ranging from 0 up to 1759 (DD disk) or 3519 (HD disk)).- value
An
amigaBlock
object with which the block at the specified location on the disk needs to be replaced.
Value
The amigaBlock
object at the specified location
is returned. In case of the replace method, an amigaDisk
object with a replaced amigaBlock
is returned.
Details
Information is stored in 512 byte blocks on floppy disks. This method
extracts a specific block at a numeric
identifier (whole numbers
ranging from 0 up to 1759 (DD disk) or 3519 (HD disk)) from an
amigaDisk
object.
See also
Other block.operations:
get.blockID()
,
get.diskLocation()
Examples
## get the root block from the example adf:
amigaBlock(adf.example, 880)
#> 0x000 00000002 00000000 00000000 00000048 ...............H
#> 0x010 00000000 F665FC39 00000000 00000000 ....öeü9........
#> 0x020 00000000 00000000 00000000 00000000 ................
#> 0x030 00000000 00000000 00000000 00000000 ................
#> 0x040 00000000 00000000 00000000 00000000 ................
#> 0x050 00000000 00000000 00000000 00000000 ................
#> 0x060 00000000 00000000 00000000 00000000 ................
#> 0x070 00000373 00000000 00000372 00000000 ...s.......r....
#> 0x080 00000000 00000000 00000000 00000000 ................
#> 0x090 00000000 00000000 00000000 00000000 ................
#> 0x0A0 00000000 00000000 00000000 00000000 ................
#> 0x0B0 00000000 00000000 00000000 00000000 ................
#> 0x0C0 00000000 00000000 00000000 00000000 ................
#> 0x0D0 00000000 00000000 00000375 00000000 ...........u....
#> 0x0E0 00000000 00000374 00000000 00000000 .......t........
#> 0x0F0 00000000 00000000 00000000 00000000 ................
#> 0x100 00000000 00000000 00000000 00000000 ................
#> 0x110 00000000 00000000 00000000 00000000 ................
#> 0x120 00000000 00000000 00000000 00000000 ................
#> 0x130 00000000 00000000 FFFFFFFF 00000371 ........ÿÿÿÿ...q
#> 0x140 00000000 00000000 00000000 00000000 ................
#> 0x150 00000000 00000000 00000000 00000000 ................
#> 0x160 00000000 00000000 00000000 00000000 ................
#> 0x170 00000000 00000000 00000000 00000000 ................
#> 0x180 00000000 00000000 00000000 00000000 ................
#> 0x190 00000000 00000000 00000000 00000000 ................
#> 0x1A0 00000000 000038C6 0000027D 00000716 ......8Æ...}....
#> 0x1B0 0D616466 4578616D 706C654F 46530000 .adfExampleOFS..
#> 0x1C0 00000000 00000000 00000000 00000000 ................
#> 0x1D0 00000000 00000000 000038C6 000002B5 ..........8Æ...µ
#> 0x1E0 000006DB 000038C6 000001C4 000007E3 ...Û..8Æ...Ä...ã
#> 0x1F0 00000000 00000000 00000000 00000001 ................
## Create a completely blank disk without file system:
blank.disk <- new("amigaDisk")
## Replace the boot block on the blank disk with
## that from the example object:
amigaBlock(blank.disk, 0) <- amigaBlock(adf.example, 0)
## The blank disk now has a boot block,
## but still no file system...