Skip to content

Commit

Permalink
merge changes
Browse files Browse the repository at this point in the history
  • Loading branch information
arrgee23 committed Jul 28, 2019
2 parents 6014a3b + 93cee76 commit 30d7ee7
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions common.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ WholeFS* readFS(char const *fileName,int* isInitialized)
fs->fileSystemName = Malloc(512, char);
strcpy(fs->fileSystemName, fileName);

printf("Temp Code %d\n", tmp);
//printf("Temp Code %d\n", tmp);
if(tmp==code) // fresh
{
// super block
Expand Down Expand Up @@ -161,7 +161,7 @@ WholeFS* readFS(char const *fileName,int* isInitialized)
}
else // read from the file to memory structure
{
printf("****superblock print");
//printf("****superblock print");
readSuperBlock(fs);
char *buff = readInodeBlockFromFile(fs,fs->pwdInodeNumber);
Inode *inode = strToInode(buff,sizeof(Inode));
Expand Down
2 changes: 1 addition & 1 deletion driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ int main(int argc, char const *argv[])
else if(strcmp(commandName, "rm") == 0)
{
//printf("Currently under development\n");
printf("Enter the pathname\n");
//printf("Enter the pathname\n");
scanf("%s", arg1);
int res = system_rm( fileSystem, arg1,strlen(arg1));

Expand Down
16 changes: 8 additions & 8 deletions file_handling_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ void readSuperBlock(WholeFS* fs)


/*print */
printf("inodecount: %d \n", (fs->sb.inodeCount));
printf("freeInode: %d \n", (fs->sb.freeInodeCount));
printf("inodeOfsset: %d \n", (fs->sb.iNodeOffset));
printf("datablockoffset %d \n", (fs->sb.dataBlockOffset));
printf("datablockCount %d \n", (fs->sb.dataBlockCount));
printf("freeDataBlockCount %d\n", (fs->sb.freeDataBlockCount));
printf("inodesize: %d ", (fs->sb.iNodeSize));
printf("datablocksize: %d ", (fs->sb.dataBlockSize));
//printf("inodecount: %d \n", (fs->sb.inodeCount));
//printf("freeInode: %d \n", (fs->sb.freeInodeCount));
//printf("inodeOfsset: %d \n", (fs->sb.iNodeOffset));
//printf("datablockoffset %d \n", (fs->sb.dataBlockOffset));
//printf("datablockCount %d \n", (fs->sb.dataBlockCount));
//printf("freeDataBlockCount %d\n", (fs->sb.freeDataBlockCount));
//printf("inodesize: %d ", (fs->sb.iNodeSize));
//printf("datablocksize: %d ", (fs->sb.dataBlockSize));

fs->pwdInodeNumber = 1;
strcpy(fs->pwdPath,"/");
Expand Down
4 changes: 1 addition & 3 deletions system.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void system_pwd(WholeFS *fs)

int system_rm(WholeFS* fs,char* name,int len)
{
printf("###################################################################");
//printf("###################################################################");
// get current inode number of current working directory
int dirInode = getPwdInodeNumber(fs);

Expand Down Expand Up @@ -214,8 +214,6 @@ int system_rm(WholeFS* fs,char* name,int len)
}

}

//}

printf("\nFile Not found") ;
return 0;
Expand Down
12 changes: 7 additions & 5 deletions util.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,13 @@ void printDirectoryContent(WholeFS* fs,char *data,int size)

sscanf(data+offset,"%d %s",&inodeIndex,name);
//printf("index: %d, name : %s \n",inodeIndex,name);
buffer = readInodeBlockFromFile(fs,inodeIndex);
//printf("buffer : %s\n",buffer);
inode = strToInode(buffer,sizeof(Inode));
printf("fileMode : %c ,fileSize: %d, linkCount: %d, name: %s \n",getFileType(inode->fileMode),inode->fileSize,inode->linkCount,name);

if(inodeIndex > 0)
{
buffer = readInodeBlockFromFile(fs,inodeIndex);
//printf("buffer : %s\n",buffer);
inode = strToInode(buffer,sizeof(Inode));
printf("fileMode : %c ,fileSize: %d, linkCount: %d, name: %s \n",getFileType(inode->fileMode),inode->fileSize,inode->linkCount,name);
}
offset += DIRECTORY_ENTRY_LENGTH;
}
}
Expand Down

0 comments on commit 30d7ee7

Please sign in to comment.