Skip to content
Permalink
Browse files

10x too small, bt working

  • Loading branch information
joshspicer committed Dec 5, 2017
1 parent b7ec2d8 commit f93a52c0d403fb7a69484180e2d30b02f2496b1a
Showing with 14 additions and 9 deletions.
  1. BIN nufs
  2. +1 −2 nufs.c
  3. +9 −7 test.log
  4. +4 −0 test.pl
BIN +184 Bytes (100%) nufs
Binary file not shown.
3 nufs.c
@@ -277,8 +277,7 @@ nufs_write(const char *path, const char *buf, size_t size, off_t offset,
printf("Inside over 4K writing block for <%s> ", node->path); //REMOVE
printf("Size Remaining: %d\n", sizeRemaining); //REMOVE

int idx = size / 4096;
void *additionalPtr = data_block_ptr_at_index(node->additionalBlocks[idx]);
void *additionalPtr = data_block_ptr_at_index(node->additionalBlocks[looped]);

// Mem copy the offset data in 4k increments.
int sizeToCopy = 4096;
@@ -14,14 +14,12 @@ A: -1, B: -1, C: -1,

node{mode: 40755, size: 0, xtra: 145, path: /, name: , blockID: 0, InodeID: 0}
access(/, 0004)
getattr(/.Trash)
getattr(/.Trash-1000)
getattr(/.xdg-volume-info)
getattr(/autorun.inf)
getattr(/)
File </> FOUND in get_file_data
getattr(/)
File </> FOUND in get_file_data
getattr(/autorun.inf)
getattr(/.Trash)
getattr(/.Trash-1000)
readdir(/)
File </> FOUND in get_file_data
getattr(/)
@@ -138,6 +136,8 @@ read(/one.txt, 4096 bytes, @0)
File </one.txt> FOUND in get_file_data
getattr(/one.txt)
File </one.txt> FOUND in get_file_data
getattr(/one.txt)
File </one.txt> FOUND in get_file_data
getattr(/two.txt)
mknod(/two.txt, 100664)
BLOCK 2 FOUND FOR INODE
@@ -177,9 +177,9 @@ A: -1, B: -1, C: -1,
D: -1, E: -1, F: -1,
G: -1, H: -1, I: -1}

node{mode: 100664, size: 0, xtra: 0, pathmake[1]: Entering directory '/home/josh/Desktop/challenge03'
node{mode: 100664, size: 0,make[1]: Entering directory '/home/josh/Desktop/challenge03'
fusermount -u mnt || true
: /2k.txt, name: 2k.txt, blockID: 3, InodeID: 3}
xtra: 0, path: /2k.txt, name: 2k.txt, blockID: 3, InodeID: 3}
getattr(/2k.txt)
File </2k.txt> FOUND in get_file_data
getattr(/)
@@ -197,6 +197,8 @@ File </2k.txt> FOUND in get_file_data
open(/2k.txt)
read(/2k.txt, 4096 bytes, @0)
File </2k.txt> FOUND in get_file_data
getattr(/)
File </> FOUND in get_file_data
make[1]: Leaving directory '/home/josh/Desktop/challenge03'
make[1]: Leaving directory '/home/josh/Desktop/challenge03'
make[1]: Entering directory '/home/josh/Desktop/challenge03'
@@ -135,6 +135,10 @@ sub read_text_slice {
write_text("40k.txt", $huge0);
my $huge1 = read_text("40k.txt");
ok($huge0 eq $huge1, "Read back 40k correctly.");
#Josh added this
say "# EXPECTED: '$huge0'";
say '-------------';
say "# ACTUAL: '$huge1'";

my $huge2 = read_text_slice("40k.txt", 10, 8050);
$right = "ng is four";

0 comments on commit f93a52c

Please sign in to comment.
You can’t perform that action at this time.