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
Solved

MacIntosh Characters

Posted on 1998-10-19
5
155 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
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
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…

856 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