Answer:
file_name = 'orders.txt'
file_obj = open( file_name, 'r' )
lines = file_obj.read()
print(lines.upper(), end = '')
Explanation:
- Define the name of the file
.
- Use the built-in open function to open the file in read mode
.
- Use the built-in read function to read the file and assign this to lines variable.
- Finally display the lines by converting them to capital alphabets by using the built-in upper() function.
It’s b just really got to make since an read it right that’s all
The allocation methods define how the files are stored in the disk blocks.
There are three main disk space or file allocation methods:
1.Contiguous Allocation-in this scheme,each file occupies a set of blocks on the disk. For example if a file requires x blocks and is given a block y as the starting location,then the blocks assigned to the file be :x,y+1,y+2,......y+x-1.
This means that given the starting block address and the length of the file(in terms of blocks required) we can determine the blocks occupied by the file.
Advantages
-both the sequential and direct accesses are supported
-this is extremely fast since the number of seeks are minimal because of contiguous allocation of file blocks.
2.linked allocation-in this scheme,each file linked list of disk blocks which need not be contiguous disk blocks can be scattered anywhere on the disk.
Advantages
it is very flexible in terms of file size.file size can be increased easily since the system does not have to look for a contiguous chunk
of memory.
this method does not suffer from external fragmentation and it makes it relatively better in terms of memory utilization.
3.Indexed Allocation-in this scheme,a special block known as the index block contains the pointers to all the blocks occupied by a file.Each file has its own index block.the entry in the index block contains the disk address of the block
Advantages
it supports direct access to the blocks occupied by the file and therefore provides fast access to the file blocks
it overcomes the problem of external fragmentation.