Sorry for the really late response.
I checked this problem again running from a Mac hard disk and
from an EtherShare volume, no difference.
Um 10:37 Uhr +0100 04.03.2002, schrieb Beat Pfister:
>I tried to edit postscript files with perl, but no I reconiced that perl
>changes the line ending charackters even if I only open the file and save it
>in a new file. Every "\n" is changed to an "\r", with this changes the
>postscript file can no logner be interpreted by a printer.
First I think it doesn't matter for a PostScript interpreter
if line endings are Mac or Unix or DOSish. This might not be
true for intermediate filters though.
Your Mac code undefines the input line separator $/ and
thereby reads a single line at once and spits it out with no
changes.
undef $/;
open FI, "<:infile" or die $!;
open FO, ">:outfile" or die $!;
while (<FI>) {
print FO $_;
}
close FI;
close FO;
You can check in the debugger that the print within the while loop is
executed only once.
In short - Unix files in, Unix files out, as said above with no
difference when run from a local disk or a network share. Check
on the server:
# sum mac/infile mac/outfile
35841 1 mac/infile
35841 1 mac/outfile
The Unix example you put in iDrive uses #!perl -lw.
This will end each print statement with newlines, executed
under Unix a 0x0a, under Mac a 0x0d.
I cannot find any MacPerl problems here.
If you need further help let's discuss this directly.
Perhaps it is a Helios EtherShare specific setup problem...
Axel
rest of original posting:
>That's the code I use:
>
> undef $/; #Zeilenende
>undef, Datei nicht Zeilenweise bearbeiten
>
> open(NEU, "> $neu") or die "Fehler beim �ffnen
>der Datei: $neu $!";
> open(PS, "$psname") or die "Fehler beim �ffnen der
>Datei: $psname $!";
>
> while (<PS>) {
> print NEU $_;
> }
>
> close(PS) or die "Kann $psname nicht schliessen: $! ";
> close(NEU) or die "Kann $neu nicht schliessen: $! ";