Solved

MacIntosh Characters

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
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…

752 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