- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have some FORTRAN code that opens a file with FORM = 'FORMATTED', STATUS = 'UNKNOWN', RECL = 1024, CARRIAGECONTROL = 'LIST'. I write out some formatted records.
I can open my file in Notepad, which seems happy that the content it text (or at least, can be displayed as text).
If I use DevStudio to try to open the file, specifying the type as Text, DevStudio claims the file is binary and won't open it (it will open it as binary).
If I then open the file in Notepad, save it and close it, I can then open it in DevStudio as text.
I checked and the file does not change size in any way, even by a byte. So how does DevStudio determine the type of the contents of a file? And why does it 'get it wrong'?
Of course, Notepad is probably displaying a binary file as text (as it always tries to do), it just so happens that the binary is text...
I can open my file in Notepad, which seems happy that the content it text (or at least, can be displayed as text).
If I use DevStudio to try to open the file, specifying the type as Text, DevStudio claims the file is binary and won't open it (it will open it as binary).
If I then open the file in Notepad, save it and close it, I can then open it in DevStudio as text.
I checked and the file does not change size in any way, even by a byte. So how does DevStudio determine the type of the contents of a file? And why does it 'get it wrong'?
Of course, Notepad is probably displaying a binary file as text (as it always tries to do), it just so happens that the binary is text...
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My recollection is that DevStudio looks to see if there non-printing characters in the file. I'd want to see the actual file (before NOTEPAD) before commenting further - can you attach a ZIP archive of an example?
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve, you're right, my original file has some NULL characters in it, which are replaced with spaces when saved from notepad. Seems odd because they result from the line:
WRITE (filun, 1000) in_field
where
1000 FORMAT (6(A,','))
(in_field is a CHARACTER*16 array, width = 18)
The same formatting line is used elsewhere and does not output NULLs. E.g.:
WRITE (filun, 1000) in_unit
where in_unit is a CHARACTER*10 array).
WRITE (filun, 1000) in_field
where
1000 FORMAT (6(A
(in_field is a CHARACTER*16 array, width = 18)
The same formatting line is used elsewhere and does not output NULLs. E.g.:
WRITE (filun, 1000) in_unit
where in_unit is a CHARACTER*10 array).

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