- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is hopefully a simple question:
During the execution of my application I need to createsome text files and save data in those. The data files need to becreatedin a subdirectory of the current directory (ie where the input data file is located). The problem I have is that the subdirectory cannot be created before the execution of the program since the name etc is not known before hand.
The question: Is there a way during the execution of an application to create a directory?
Any suggestion will be greatly appreciated.
Thanks,
Petros
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sure - the Win32 API routine CreateDirectory, defined in module kernel32 Quick example
program credir
use kernel32
implicit none
integer(BOOL) ret
ret = CreateDirectory("subdir"C, NULL)
if (ret == 0) then
print *, "CreateDirectory failed, status = ", GetLastError()
end if
end program credir
program credir
use kernel32
implicit none
integer(BOOL) ret
ret = CreateDirectory("subdir"C, NULL)
if (ret == 0) then
print *, "CreateDirectory failed, status = ", GetLastError()
end if
end program credir

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page