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
294
                 call execute_move_file(move_source_path, current_dir, current_files(move_dest_selected), &
294
                 call execute_move_file(move_source_path, current_dir, current_files(move_dest_selected), &
295
                                       current_is_dir(move_dest_selected))
295
                                       current_is_dir(move_dest_selected))
296
                 move_mode = .false.
296
                 move_mode = .false.
297
-            else if (.not. current_is_dir(selected) .and. &
297
+            else if (trim(current_files(selected)) /= "." .and. trim(current_files(selected)) /= "..") then
298
-                     trim(current_files(selected)) /= "." .and. trim(current_files(selected)) /= "..") then
298
+                ! Enter move mode - store source file or directory
299
-                ! Enter move mode - store source file
300
                 move_source_path = join_path(current_dir, current_files(selected))
299
                 move_source_path = join_path(current_dir, current_files(selected))
301
                 move_source_name = current_files(selected)
300
                 move_source_name = current_files(selected)
302
                 move_mode = .true.
301
                 move_mode = .true.
@@ -434,12 +433,12 @@ contains
434
         write(output_unit, '(a)') BOLD // "Move Result" // RESET
433
         write(output_unit, '(a)') BOLD // "Move Result" // RESET
435
         write(output_unit, *)
434
         write(output_unit, *)
436
         if (stat == 0) then
435
         if (stat == 0) then
437
-            write(output_unit, '(a)') GREEN // "✓ File moved successfully!" // RESET
436
+            write(output_unit, '(a)') GREEN // "✓ Moved successfully!" // RESET
438
             write(output_unit, '(a)') "  From: " // trim(source_path)
437
             write(output_unit, '(a)') "  From: " // trim(source_path)
439
             write(output_unit, '(a)') "  To:   " // trim(dest_path)
438
             write(output_unit, '(a)') "  To:   " // trim(dest_path)
440
         else
439
         else
441
             write(output_unit, '(a)') RED // "✗ Move failed" // RESET
440
             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)"
443
         end if
442
         end if
444
         write(output_unit, *)
443
         write(output_unit, *)
445
 
444
 
scratchdir/scratch/one.txtadded
scratchdir/scratch/two.txtadded