stfark1
Joined: 02 Sep 2008 Posts: 210
|
Posted: Thu Nov 19, 2009 7:18 pm Post subject: File Assignment |
|
|
I Installed Windows 7, am using SilverFrost Fortran. The input file I want to access is loaded under Windows 7 as Disk Address "F:" When I issue the fortran statement:
OPEN (UNIT=5, FILE = 'F:\Fortran\FORTRAN\BINB\CONSOLEIN.txt') , I get a run time error "cannot find the path requested". Any ideas? Sid Kraft |
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2555 Location: Sydney
|
Posted: Fri Nov 20, 2009 2:03 am Post subject: |
|
|
Why not try "get_filtered_file@" to see what is available. My example file searcher that works on XP is below.
Code: | subroutine select_file (file_name, project)
use mswin
!
character (len=*) :: file_name
character (len=*) :: project
!
integer :: number_of_filters, i
logical :: must_exist
!
character (len=128) :: path
character (len=15),dimension (5) :: filter_names
character (len=10),dimension (5) :: filters
character (len=20) :: title
!
path = 'c:\temp'
!
title = 'New Project File'
file_name = ' '
number_of_filters = 4
filter_names(1) = 'Data files' ; filters(1) = '*.dat'
filter_names(2) = 'Text files' ; filters(2) = '*.txt'
filter_names(3) = 'Fortran files' ; filters(3) = '*.f95'
filter_names(4) = 'All files' ; filters(4) = '*.*'
must_exist = .true.
!
call get_filtered_file@ (title, file_name, path, &
filter_names, filters, number_of_filters, must_exist)
!
i = index (file_name, '\', .true.)
if (i > 0 .and. len_trim(project) > 1) then
path = file_name(1:i)
call use_path_name (path, 'SET', Project)
end if
!
write (*,*) 'Project: ', project
write (*,*) 'Title : ', title
write (*,*) 'Path : ', path
write (*,*) 'File : ', file_name
!
end subroutine select_file
|
|
|