Vidir: Difference between revisions

95 bytes added ,  3 years ago
m
m (clarify)
m (→‎{{header|Raku}}: twiddles)
Line 127:
'''Positionals:'''
* '''path''', string, optional, defaults to the present directory (relative './').
* '''filter''', string, optional, defaults to none. A regex assertion you can use to filter the returned file names. E.G. '''\.txt$''' (filenames ending with .txt extension)
 
 
Line 133:
* '''-r''', recurse, flag, optional, default False. Recurse into nested directories and process those files as well.
* '''-v''', verbose, flag, optional, default False. Be chatty about what is going on when making changes.
* '''--editor=whatever''' or '''--e=whatever''', string, optional, defaults the default text editor. Pass in a command name to specify a specific editor: (E.G. '''--editor=vim''')
 
 
Will get a list of all file names from the specified director(y|ies), put them in a temporary file and open the text file with the default (or specified) text editor.
 
Edit the file names or directory names, addin filesthe text editor: add, remove, filesmodify file names, andthen save the text file; all of the modifications made to the text file will be applied to the file system.
 
'''To edit a file name:''' Just edit the file name, extension, whatever. '''Warning!''' There is nothing preventing you from using characters in the file name which will make it difficult to open, modify or delete the file. You can screw yourself quite easily if you make an effort. With great power comes great responsibility. The foot cannon is primed and loaded.
 
If you add a forward solidus (directory separator: '''/''') to a filename, it will treat anything between separators as a directory name and '''WILL CREATE''' non-existent directories.
 
'''To move a file:''' Edit the directory path. theThe file will be moved to the new path. Non-existing directories will be created.
 
'''To delete a file:''' Delete the entire line (file name and identifier) in the text file.
 
'''To add a file:''' Add a new line with a unique integer (need not be in any order), one or more tabs, then the new file path/name. mayMay be a relative or absolute path.
 
Notice that all of the above operations will fail to apply if you lack sufficient permissions for the affected files or directories.
 
<lang perl6>use Sort::Naturally;
10,327

edits