1
0
mirror of https://github.com/DoctorWkt/pdp7-unix.git synced 2026-01-28 04:58:08 +00:00

Oops, I forgot to actually write the file contents into the filesystem image.

This commit is contained in:
Warren Toomey
2016-03-10 12:54:46 +10:00
parent d1b995e771
commit 3ef14fa6f6

View File

@@ -323,6 +323,18 @@ sub add_file {
# Allocate enough blocks for the file
my @blklist = allocate_blocks($size);
# Put the contents of the file into the blocks
my ($blocknum, $offset)= ($blklist[0], 0);
dprint("Filling block $blocknum with content from $extfile\n");
foreach my $i (0 .. $size-1) {
$Block[$blocknum][$offset++]= $buf[$i];
if ( $offset == WORDSPERBLK ) {
$offset = 0;
$blocknum++;
dprint("Filling block $blocknum with content from $extfile\n");
}
}
# If it's too big, allocate indirect blocks
my $large = 0;
my @indblocks;