- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For the code below I am using Intel Fortran 14.0.5.239 (64-bit) on Windows 7. Multiple images attempt to write (in orderly fashion) to a file that has been created with the SHARE='DENYNONE' attribute; and yet only the last image writes to it.
I may be overlooking something here, but this behavior puzzles me.
PROGRAM COARRAY_FILE_WRITE USE ISO_FORTRAN_ENV IMPLICIT NONE INTEGER :: I_IMAGE LOGICAL :: LOCK_IS_ACQUIRED TYPE(LOCK_TYPE) :: FILE_LOCK
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Each image keeps its own file position pointer - you're overwriting the same record in all the images. The type of shared file access you want doesn't really exist in Windows. You'd have to close and reopen the file each time to get the position consistent.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ah, ok - thanks Steve, your explanation makes a lot of sense.
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