Skip to content

heinsmit06/file-system-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

backend-1-my-fs-heinsmit06

My FileSystem CLI Program


CLI program with functionality of working with files in a file system. The methods that can be executed by the program:

  • ls - displays a list of all files and directories for path:

      public static void listDirectory(String path) {...};    
    
  • ls_py - displays a list of files with the .py extension in `path

      public static void listPythonFiles(String path) {...};    
    
  • id_dir - outputs true if path is a directory, otherwise false

      public static void isDirectory(String path) {...};    
    
  • define - outputs directory or file depending on the type of path

      public static void define(String path) {...};    
    
  • readmod - displays rights for the file in rwx format for the current user

      public static void printPermissions(String path) {...};    
    
  • setmod - sets rights for the file path

      public static void setPermissions(String path, String permissions) {...};   
    
  • cat - displays file content

      public static void printContent(String path) {...};   
    
  • append - adds the line # Autogenerated line at the end of path

      public static void appendFooter(String path) {...};    
    
  • bc - creates a copy of path in the directory /tmp/${date}.backup, where date is the date in the format dd-mm-yyyy. path can be a directory or a file. When a directory, the entire content is copied.

      public static void createBackup(String path) {...};    
    
  • greplong - displays the longest word in the file

      public static void printLongestWord(String path) {...};
    
  • help - displays a list of commands and their descriptions

      public static void help() {...};    
    
  • exit - terminates the program

      public static void exit() {...};
    

After launching, the program should display a list of available commands and their descriptions; then wait for a command from the user. The available commands can also be accessed through the help() method.

The program is undone, there are some blocks of code that need to be restructured or additional consideration regarding exceptions. Also, the backup method does not yet work as intended. All of these will be improved in the future.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages