JohnCampbell
Joined: 16 Feb 2006 Posts: 2554 Location: Sydney
|
Posted: Tue Oct 17, 2006 8:09 pm Post subject: attach@ and Windows XP |
|
|
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 cmnam*256, target_path*256, &
curdir@*256, default_path*256
integer*2 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
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Wed Oct 18, 2006 6:43 am Post subject: attach@ and Windows XP |
|
|
John
I think the short answer is no.
You can change the current working directory within the current process but it does not change the current working directory in the calling process. In other words, the change is only effective whilst the executable is running. |
|