Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

ascii & newlines in unformatted file
I am trying to write a dataset in binary vtk file.
The format of the vtk file should be:

# vtk DataFile Version 2.0
Comment line
BINARY
DATASET STRUCTURED_GRID
DIMENSIONS        20        20         1
POINTS       400 double
<point coordinates in binary>
....
POINT_DATA                  400
FIELD metrics 1
area 1                 400 double
<"area" dataset in binary>
EOF

Whitespace and newlines are important.
How can I write this file without closing it and re-opening to
append? Another question is whether the values put by the
unformatted write in the file are those that a library written in
c++ (VTK) would expect to find there. I am not even sure that the
size of a single value is 4 bytes, as it should be.
I am using x86 linux and ifort 8.0, portability is not an issue.

Report this thread to moderator Post Follow-up to this message
Old Post
Giorgos Momferratos
10-13-04 08:59 PM


RE: ascii & newlines in unformatted file
In a previous article, Giorgos Momferratos <mc01627@mail.ntua.gr> wrote:
>I am trying to write a dataset in binary vtk file.
>The format of the vtk file should be:
>
># vtk DataFile Version 2.0
>Comment line
>BINARY
>DATASET STRUCTURED_GRID
>DIMENSIONS        20        20         1
>POINTS       400 double
><point coordinates in binary>
>....
>POINT_DATA                  400
>FIELD metrics 1
>area 1                 400 double
><"area" dataset in binary>
>EOF
>
>Whitespace and newlines are important.
>How can I write this file without closing it and re-opening to
>append? Another question is whether the values put by the
>unformatted write in the file are those that a library written in
>c++ (VTK) would expect to find there. I am not even sure that the
>size of a single value is 4 bytes, as it should be.
>I am using x86 linux and ifort 8.0, portability is not an issue.

If I were doing that I would choose either unformatted -
all binary - and make up your own CR LF as necessary

or

do all formatted and use hex for the binary part (e.g. z8 or whatever)
You might have to write a translation ... but better that
than mixing formatted and unf.

Chris


Report this thread to moderator Post Follow-up to this message
Old Post
meek@skyway.usask.ca
10-13-04 08:59 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Fortran archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:59 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.