Solved

MacIntosh Characters

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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.…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now