ECS36B computer

2024-01-02 12:41:33

Part 1:?split a large file into fixed-size pieces and re-join them

As common file/database size is getting much larger these days, it is handy to be able to break?them into small pieces for the purpose of storage or internet transfer, and then to heal?them back together to the original form whenever needed. For this homework assignment, we will build such tools (also to apply what you might have learned from ecs36a) --

(Programs) myHeal and myBreak are two utility programs for separating a giant file into smaller-sized chunks and re-assembling the chunks back to their original.

myBreak: the myBreak program will separate the source file, typically very large file size, into fixed-size chunks (for example, 1 MB a piece). You have the freedom to design how you like to separate them (of course, your own myHeal program will put them back correctly), but the program must take the following arguments:

usage: ./myBreak <source> <prefix> <chunk size (K)>

Here is an example è

(base) MBP:myBreakHeal sfwu$ ls -l toID_sorted_Lall_LIS.xls

-rw-r--r-- ?1 sfwu ?staff ?710779752 Sep 30 12:15 toID_sorted_Lall_LIS.xls

(base) MBP:myBreakHeal sfwu$ ./myBreak toID_sorted_Lall_LIS.xls myPrefix 65536

?starting myPrefix.00000000000000000000000000000000

?starting myPrefix.00000000000000000000000000000001

?starting myPrefix.00000000000000000000000000000002

?starting myPrefix.00000000000000000000000000000003

?starting myPrefix.00000000000000000000000000000004

?starting myPrefix.00000000000000000000000000000005

?starting myPrefix.00000000000000000000000000000006

?starting myPrefix.00000000000000000000000000000007

?starting myPrefix.00000000000000000000000000000008

?starting myPrefix.00000000000000000000000000000009

?starting myPrefix.00000000000000000000000000000010

done... [11] chunks produced for toID_sorted_Lall_LIS.xls

While you can design and implement your own version of myBreak program, the source code of a reference implementation of myBreak.c will be provided.

myHeal: the myHeal program will re-generate the original file broken by the myBreak program. For error handling, the program needs to detect if any chunk is missing and also the chunk size of incorrect.

Here is the example è

文章来源:https://blog.csdn.net/2301_81917451/article/details/135337017
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。