Click here to get back home

copy stdout fails with permission denied when stdout is redirected

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
copy stdout fails with permission denied when stdout is redirected brian.mabry.edwards@gmail.com 12-07-2005
Posted by brian.mabry.edwards@gmail.com on December 7, 2005, 1:15 pm
Please log in for more thread options
>>
>> [snip]
>>
>> > if I print "$1\n",
>> > the file prints just fine. But, if I do something like print "$1 after
>> > \n", the whole output is messed up. If I print "before $1\n", nothing
>> > prints at all. If I print "before $1 after\n", only after prints.
>>
>> not really sure, but could be a rogue "\r" in $1,


> There
> is a rogue carriage return (0xd) in the string

> Is there something I can do to deal with this
> situation?


Repair the corrupted file:

perl -p -i -e 'tr/\r//d' bad_file


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas

Posted by usenet on December 7, 2005, 1:49 pm
Please log in for more thread options
>>
>> [snip]
>>
>> > if I print "$1\n",
>> > the file prints just fine. But, if I do something like print "$1 after
>> > \n", the whole output is messed up. If I print "before $1\n", nothing
>> > prints at all. If I print "before $1 after\n", only after prints.
>>
>> not really sure, but could be a rogue "\r" in $1,


> There
> is a rogue carriage return (0xd) in the string

> Is there something I can do to deal with this
> situation?


Repair the corrupted file:

perl -p -i -e 'tr/\r//d' bad_file


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas

Posted by A. Sinan Unur on December 7, 2005, 10:49 pm
Please log in for more thread options
>>
>> [snip]
>>
>> > if I print "$1\n",
>> > the file prints just fine. But, if I do something like print "$1 after
>> > \n", the whole output is messed up. If I print "before $1\n", nothing
>> > prints at all. If I print "before $1 after\n", only after prints.
>>
>> not really sure, but could be a rogue "\r" in $1,


> There
> is a rogue carriage return (0xd) in the string

> Is there something I can do to deal with this
> situation?


Repair the corrupted file:

perl -p -i -e 'tr/\r//d' bad_file


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas

Similar ThreadsPosted
How can I know if STDOUT has been redirected? October 20, 2004, 4:13 pm
STDOUT and STDERR redirection fails for forked process July 19, 2007, 4:06 am
STDOUT and STDERR redirection fails for forked process July 19, 2007, 6:09 am
new IO::Socket::INET + UDP/Broadcast = Permission denied ?? Why? March 9, 2005, 2:20 pm
IIS calling cscript.exe from cgi permission denied - WMI access April 11, 2005, 5:12 am
Problem Creating Socket : Permission Denied August 20, 2007, 11:23 am
Permission denied trying to execute shell commands from Perl/CGI. August 22, 2006, 3:00 pm
Permission Denied error when moving files - Perl November 10, 2006, 12:13 pm
Permission denied at C:/Perl/site/lib/XML/Handler/YAWriter.pm line 43. February 24, 2005, 12:59 am
"copy" from File::Copy fails but returns success October 16, 2007, 4:43 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap