fortrangoingonforty/fortress / 89ebff6

Browse files

recursive move directories

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
89ebff6a04b849b3f76e205b72352e0afb7dbcef
Parents
503dae0
Tree
ef396c9

3 changed files

StatusFile+-
M app/main.f90 4 5
A scratchdir/scratch/one.txt 0 0
A scratchdir/scratch/two.txt 0 0
app/main.f90modified
@@ -294,9 +294,8 @@ program fortress
294294
                 call execute_move_file(move_source_path, current_dir, current_files(move_dest_selected), &
295295
                                       current_is_dir(move_dest_selected))
296296
                 move_mode = .false.
297
-            else if (.not. current_is_dir(selected) .and. &
298
-                     trim(current_files(selected)) /= "." .and. trim(current_files(selected)) /= "..") then
299
-                ! Enter move mode - store source file
297
+            else if (trim(current_files(selected)) /= "." .and. trim(current_files(selected)) /= "..") then
298
+                ! Enter move mode - store source file or directory
300299
                 move_source_path = join_path(current_dir, current_files(selected))
301300
                 move_source_name = current_files(selected)
302301
                 move_mode = .true.
@@ -434,12 +433,12 @@ contains
434433
         write(output_unit, '(a)') BOLD // "Move Result" // RESET
435434
         write(output_unit, *)
436435
         if (stat == 0) then
437
-            write(output_unit, '(a)') GREEN // "✓ File moved successfully!" // RESET
436
+            write(output_unit, '(a)') GREEN // "✓ Moved successfully!" // RESET
438437
             write(output_unit, '(a)') "  From: " // trim(source_path)
439438
             write(output_unit, '(a)') "  To:   " // trim(dest_path)
440439
         else
441440
             write(output_unit, '(a)') RED // "✗ Move failed" // RESET
442
-            write(output_unit, '(a)') "  (file may already exist or invalid destination)"
441
+            write(output_unit, '(a)') "  (destination may already exist or be invalid)"
443442
         end if
444443
         write(output_unit, *)
445444
 
scratchdir/scratch/one.txtadded
scratchdir/scratch/two.txtadded