comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: checking if file is dos textfile or unix textfile ?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: checking if file is dos textfile or unix textfile ? [message #38630 is a reply to message #38626] Fri, 19 March 2004 06:26 Go to previous messageGo to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Klemens Barfus wrote:
> Hello together,
> following from a question some months ago, this question arised:
> how can I check if a textfile is dos or unix formatted ? Which way do I
> have to open it in IDL under windows (older IDL version 5.2.1) ? How do
> I have to read from the file to check the format ?
>
> Thanks for your help in advance !
>
> Klemens
>

What kind of problems do you have?


You could read the file in binary and test if 10b is followed by 13b.
if this is true then it is a dos file.

If you don't move a pointer in the file then you should be able to read
it the same way on both platforms.

Otherwise a good trick is to use get_file() and put_file to make a local
copy into the /tmp directory and work on that one.

Reimar
--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
============================================================ =======
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Color table editor
Next Topic: STRETCH: A bug?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 08:56:52 PDT 2025

Total time taken to generate the page: 0.00662 seconds