Code Monkey home page Code Monkey logo

defrag's Introduction

Introduction

The program is used for defragmentation of disk image files with FAT32 file system. It is split into several modules, from that each can work with its "problem domain". These modules cooperate with each other. My aim was to hide as many functions as it is possible, in order I would achieve the biggest "encapsulation" (even if the C language is not object oriented). It allowed simplier program debuging.

While writting this project I was thinking on the motto: Keep It Simple Stupid (KISS). In case of any questions, please write me on my email [email protected]

Program compiling

In order to simplify the compilation I have used the make program and I have created Makefile file. To compile the source code into binary file, type: make. The executable file is called defrag.

License

This project is released under GNU GPL v2 license.

System requirements

The software needs any distribution of UNIX/LINUX that contains tools: gcc, make, xgettext, and sed.

The xgettext program is used for automatical retrieving of strings that will be localized and therefore multilanguage is supproted. Additional translation and creation of binary localization file is needed to perform manually. Currently, there are supported 2 languages: English and Slovak.

Testing

Empty FAT32 images can be created as follows: mkfs.msdos -v -C -F 32 -n TestFAT32 fat32.img 1000. The arguments means:

  • -v - detailed information about progress
  • -C - create disk image
  • -F <%d> - FAT type (12, 16, 32)
  • -n <%s> - name of the partition (not necessary)
  • <name of the disk image file>
  • <size in blocks> - 1 block = 1 kB

It is possible to mount the image to real system, as follows: sudo mount fat32.img mnt/tst -t msdos -o loop=/dev/loop0, or more simplier: sudo mount fat32.img mnt/tst -o loop. The /mnt/tst should be replaced with real mount path.

The simplier variant automatically sets up the file system type and also automatically chooses the loop device. The sudo command is needed only when another user than root uses the program.

You can create scripts that would be copy and delete a lot of files. This would cause disk fragmentation. When disk is fragmented from more than 1%, the defrag utility will work. The defrag program can be executed in two ways. It can use real disks, or image files. In the case of real disk, execute it as:

defrag /dev/sda5, for example.

If the testing image is mounted, you can execute it in this way:

defrag /dev/loop0, for example.

If no image is mounted, you can execute it with a file as parameter:

defrag fat32.img, for example.

Release notes

  • v0.1b (12.11.2006)
    • Fixed all relevant bugs, command line parameters added
  • v0.1a (4.11.2006)
    • Simple defragmentation, manipulates with single cluster;
    • Not functioning checking of FAT table, working only with FAT32;
    • Algorithm as in Windows (pushes everything on the beginning).

defrag's People

Contributors

vbmacher avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.