[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: A file is not always what you think it is.





On 19 Apr 99, at 17:58, Hans van den Boogert
wrote about A file is not always what you think:



[snipped to conserve bandwidth]
> What I did: - write a script using Notepad under Winblows on the
> P200. Saved it as a .txt file. - copied it on a DOS formatted
> disk. Changed the filename to one without the .txt extension. -
> copied it on my notebook in the directory /root - chmod it, and
> ran it with the result "file not found"
>
> Apparently a .txt file written under Win95 can be chmod-ed, but
> not executed. I used ae to write a simple script from scratch
> under Linux and it worked no problem at all.



The problem is with the way 'nix and DOS/Windoze handle EOL in txt files. DOS/Windoze represents end of line as a Carriage Return + Line Feed combination (x0D0A)

'nix on the other hand uses just a LF cahracter (x0A)
[and just for the record - Mac uses just a CR (x0D)]

This was what caused the problem - Linux couldn't succesfully read the DOS text file because of the difference in formatting.

There are (freeware) programs which enable you to read/write 'nix text formatted files under windoze (as well as improving drastically on Notepads limited capabilities). Let me know if you'd like more info.

>
> That makes me wonder: I have to install some packages on the
> notebook to get the external CD-ROM drive working. If I copy them
> from the CD-ROM on a DOS formatted floppy and then transfer to the
> notebook, will I get the same kind of trouble?

The only things that give you the problem are scripts (text) files created on one system for use on the other, as noted above. A straight binary copy of a file shouldn't be a problem.

HTH
==============================
   Jan M.        -  mailto:jancm@bigfoot.com

   PGP key mailto:jancm@bigfoot.com?Subject=send%20pgp%20key
       Fingerprint:397D 093C E802 964E  5316 B90A 93CE 6696
  
Thought for the day:
    Bagpipes (n): an octopus wearing a kilt.







Reply to: