lyoutakoduka / spartaproject

MIT License
0 stars 0 forks source link

Take out directory which contain file in the archive as new archive. #33

Closed lyoutakoduka closed 6 months ago

lyoutakoduka commented 7 months ago

The process is categorized to following several pattern.

Pattern A: Do Nothing if the archive is applicable to following 2 pattern. Pattern A-1: If the archive does not include directory.

root/
|--archive.zip
    |--file

Pattern A-2: If the archive include only directory.

root/
|--archive.zip
    |--directory/

Pattern B: Take out the end of directory if the archive is applicable to following 2 pattern. Pattern B-1: If the archive include directory including file.

root/
|--archive.zip
    |--directory/
        |--file

Pattern B-2: If the archive include file and directory including file.

root/
|--archive.zip
    |--file_root
    |--directory_A/
        |--file_A
lyoutakoduka commented 7 months ago

Add take out pattern.

Pattern C: Take out the end of directories if the archive is applicable to following 2 pattern. Pattern C-1: If the archive include several directories including file.

root/
|--archive.zip
    |--directory_A/
        |--file_A
    |--directory_B/
        |--file_B

Pattern C-2: If the archive include nesting directories including file.

root/
|--archive.zip
    |--directory_A/
        |--file_A
        |--directory_B/
            |--file_B
lyoutakoduka commented 6 months ago

Add take out pattern.

Pattern D: Avoiding override of directory you took out.

root/
|--archive.zip
    |--directory_A/
        |--directory_same/
            |--file_A
    |--directory_B/
        |--directory_same/
            |--file_B
    |--directory_C/
        |--directory_same/
            |--file_C

Archives after took out directories is follow.

root/
|--directory_same.zip
    |--file_A
|--directory_same_.zip
    |--file_B
|--directory_same__.zip
    |--file_C
|--archive.zip
    |--directory_A/
    |--directory_B/
    |--directory_C/

You can confirm that under bar is adding to name of new archive.

lyoutakoduka commented 6 months ago

Add take out pattern.

Pattern E: Take out directory to specific directory.

root/
|--archive.zip
    |--directory/
        |--file

Archives after took out directories is follow.

root/
|--archive.zip
specific_root/
|--directory.zip
    |--file
lyoutakoduka commented 6 months ago

Add take out pattern.

Pattern F: Protect original archive. Archive never update even if it's edited.

root/
|--archive.zip
    |--directory/
        |--file

Archives after took out directories is follow.

root/
|--directory.zip
    |--file
|--archive.zip
    |--directory/
        |--file