naens / tofolder

Create folder based on selected file names and move

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tofolder

Purpose: create a folder based on files and move to folder

Parts of program

  • pedit-util (text tools and library: gst, unicode conversion…)
  • tofolder_cli: command line version of the application
  • tofolder_gui: gui version of the application
  • tofolder: combines both and chooses the most appropriate version depending

on context

Description of what it does

Input

The input are file names that belong to a directory. In CLI mode they are taken from cli input, and in GUI mode they are the files the user has selected before launching the program.

The user can select files / directories to move and the destination. The first list is the list of files to be moves, these are the files in the directory that contain the common substring. The second list is a list of directories that contain the common substring. The user can add or remove files in the first list and select the directory in the second list or create a new directory. When a directory is selected in the second list, it is automatically removed from the first list. If another directory is selected, whether the previous is selected or not depends on its state before being selected. By default all the files and directories are selected.

Work

The program, using the gst module, finds the longest common substring of the file names and proposes it as a name for the subfolder. If there are more files than selected that match the substring, they are also selected.

The input file names can be files or directories, belonging to the same subdirectory. Sometimes the user wants to move files to an existing directory. For this reason, if there is a directory that has a name similar to the proposed directory name, it is not selected and its name is proposed instead.

Things done by user before moving files

The user can modify the proposed name and the list of the file by adding or removing the files from the list. The user can also choose a different path for the loation of the subfolder.

Implementation

CLI

Using ncurses:

+---------------------+
| List of files        |
+---------------------+
|    x <file1>         |
|    x <file2>         |
|      <file3>         |
|    x <file4>         |
|    ...              |
+=====================+
| List of directories |
+---------------------+
|      subdir1        |
|    o subdir2        |
|      subdir3        |
|    ...              |
+---------------------+
| new: _______        |
+---------------------+
  • Both lists are scrollable if needed (horizontally and vertically).
  • Each lists takes not more space than needed.
  • The cursor selects a line by highlighting it.
  • There is no scrollbars.

GUI

to do

to do items

  • ncurses
    • test scroll
    • unicode
  • gui (using GTK)
  • tofolder executable
  • gui linux integration
  • gui windows integration
  • make install linux installation
  • linux packages: arch, crux, deb, rpm
  • windows installer

About

Create folder based on selected file names and move

License:GNU General Public License v3.0


Languages

Language:C 98.0%Language:Makefile 2.0%