I tried to get an old (DOS/FTN77) directory search routine to work, and find that it can not attach to the directory I want. The original code has a call to DIRENT@, but I found I had to replace it with FILES@. I finally found that after attaching to the selected directory, I lost the attachment on exiting the program. The following program is just the final attach@ call, but does not work as I expected, as the selected directory is lost when the program terminates. Can the attach@ call update the local directory on exiting the program below ? Does anyone know if this is a change with Windows XP, FTN95 or some other ?
! PROGRAM TO FIND THE SPECIFIED DIRECTORY ! character cmnam256, target_path256, & curdir@256, default_path256 integer2 error_code external cmnam, curdir@, attach@, doserr@ ! !--- get the local path ! default_path = curdir@() write (,) 'the current path is ', trim(default_path) ! !--- read the command line for the directory ! target_path = cmnam() write (,) 'the target directory is ', trim(target_path) ! write (,*) 'Attaching to ',trim(target_path) call attach@ (target_path, error_code) call doserr@ (error_code) ! call exit (0) ! end