Solved

MacIntosh Characters

Posted on 1998-10-19
5
158 Views
Last Modified: 2010-03-05
I have a script that reads a filesystem on NT that is a MAC filespace and copies files from it to a UNIX NFS mounted filesystem. Needless to say, MAC users put files there with funky characters. My program runs on NT and although not appearing to have a problem opening the file and reading it prior to writing it, it is having a problem writing the new file.
 
After the write, I am checking for a value returned from the write to exist, or if the expected write amount is not equal to the written amount, I check $!. The value for that variable is simply

"DEST write failed: "

ADDITIONAL INFORMATION AVAILABLE AT:

http://www.experts-exchange.com/jsp/qShow.jsp?ta=perl&qid=10089262 

Help!
Angel
0
Comment
Question by:aleyva
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 

Author Comment

by:aleyva
ID: 1205494
Edited text of question
0
 

Author Comment

by:aleyva
ID: 1205495
Adjusted points to 200
0
 
LVL 2

Expert Comment

by:WileyKat
ID: 1205496
just FYI, we Mac users do NOT put files with funky characters there. The funky characters are the fault of our Mac filesystem, which you and we have no control over. so don't criticize our file-handling techniques.
0
 
LVL 2

Expert Comment

by:WileyKat
ID: 1205497
just FYI, we Mac users do NOT put files with funky characters there. The funky characters are the fault of our Mac filesystem, which you and we have no control over. so don't criticize our file-handling techniques.
0
 
LVL 2

Accepted Solution

by:
ventolin earned 200 total points
ID: 1205498
I am not sure what your question is, but this snippet might be your answer:

while (<FILE>) {
                # convert everything to unix first
                s/\015\012/\012/g;
                s/\015/\012/g;
                # if they want dos format
                s/\012/\015\012/g if ($mode eq "dos");
                # if they want mac format
                s/\012/\015/g if ($mode eq "mac");
                $results .= $_;
                }

-ventolin
0

Featured Post

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question