Operating Systems Lab Cycle - V Programs
Cycle-5: Simulate all File Organization techniques --------------------------------------------------------------------------- a) Write a C program to simulate Single Level Directory file Organization technique Aim: To write a C program for simulating Single level Directory file Organization technique Program: #include<stdio.h> //#include<conio.h> #include<string.h> void main() { int nf=0,i=0,j=0,ch; char mdname[10],fname[10][10],name[10]; //clrscr(); printf("Enter the directory name:"); scanf("%s",mdname); printf("Enter the number of files:"); scanf("%d",&nf); do { printf("Enter file name to be created:"); scanf("%s",name); for(i=0;i<nf;i++) { if(!strcmp(name,fname[i])) break; } if(i==nf) { strcpy(fname[j++],name); nf++; } else printf("There is already %s\n",name); printf("Do you want to enter another file(yes - 1 or no - 0):"); scanf("%d",&ch); } whil...