Re: Writing $00-$FF via Fortran
- From: nospam@xxxxxxxxxxxxx (Richard Maine)
- Date: Sun, 27 Jul 2008 15:39:31 -0700
RadSurfer <RadSurfer@xxxxxxxxx> wrote:
I am in need for an important project to write out simple
unsigned-char values in the range $00 through $FF,
without any extraneous data being added:...
You want the F2003 feature stream I/O. With stream I/O, this is all
pretty straightforward; that's exactly what unformatted stream I/O does.
Just open with access='stream', form='unformatted'. Several f90/f95
compilers have implemented this f2003 feature.
If your compiler doesn't have the f2003 stream I/O feature, it almost
surely does have some simillar functionality, but alas the exact
spelling varies; that's part of why it needed standardizing in f2003.
Although the spelling varies, the functionality is pretty widespread.
If you really want to stick to something that is highly portable to all
f90/f95 (and even f77) compilers with no changes at all, one can use
unformatted direct access, but that's a bit of a pain. It has to use
fixed-size records.You can do your own record management within the
fixed-size blocks, but that can be quite a pain (I well know) and has a
bunch of caveats.
Email to: RadSurfer@xxxxxxxxx
No. I only post newsgroup answers on the newsgroup.
--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
.
- References:
- Writing $00-$FF via Fortran
- From: RadSurfer
- Writing $00-$FF via Fortran
- Prev by Date: Re: solving for m
- Next by Date: Re: [C/Fortran] writing "big" binary files issue...
- Previous by thread: Re: Writing $00-$FF via Fortran
- Next by thread: Re: Writing $00-$FF via Fortran
- Index(es):
Relevant Pages
|
|