What is talxy?

Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What is interesting here?
• Duels
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Register!

QAIX > Perl web-programming > "Illegal seek" error? 12 April 2003 01:17:10

  Top users: 
  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Модератор:

"Illegal seek" error?

Kevin Zembower 9 April 2003 23:50:32
 The second line below is causing me some problems (the first line just echos the command with the variables expanded):
print "cp -a $dirbase/$sitedir/$­_ $backupdir/$_\n" if $debug;
system "cp -a $dirbase/$sitedir/$­_ $backupdir/$_\n" or die "Can't copy to $backupdir/$_: $!";

When I run my program, I get this output:
cp -a /var/www/coreinitia­tive/htdocs/index.ht­ml /var/www/disclaimer­-backup-200304091637­/coreinitiative/htdo­cs/index.html
Can't copy to /var/www/disclaimer­-backup-200304091637­/coreinitiative/htdo­cs/index.html: Illegal seek at ./exit_disclaimer.p­l line 112.

I even changed the second line to:
system "echo -a $dirbase/$sitedir/$­_ $backupdir/$_\n" or die "Can't copy to $backupdir/$_: $!";

which doesn't try to do much of anything at all. Then, running the program gives me:
-a /var/www/coreinitia­tive/htdocs/index.ht­ml /var/www/disclaimer­-backup-200304091643­/coreinitiative/htdo­cs/index.html
Can't copy to /var/www/disclaimer­-backup-200304091643­/coreinitiative/htdo­cs/index.html: Illegal seek at ./exit_disclaimer.p­l line 112.

The first line is the 'echo', the second is the 'die' clause working.

I've tried using exec or backticks, with about the same result. Googling on "Illegal seek" produced some notes about timing and pipes, but adding a 'sleep 1' after the cp didn't help either.

Any guesses what's going wrong, and how to fix it?

Thanks for your thoughts and suggestions.

-Kevin Zembower

-----
E. Kevin Zembower
Unix Administrator
Johns Hopkins University/Center for Communications Programs
111 Market Place, Suite 310
Baltimore, MD 21202
410-659-6139
Add comment
Perl Median 9 April 2003 23:58:13 permanent link ]
 you're using system the wrong way... system returns the exit status of the
command... most commands exit 0 on success so you will always die.

you need to change the way you die:

option 1: change that "or die" to "and die" but that might confuse others

option 2: check $? (also the exit status of the last command) if it is none
zero, then die.





From: KEVIN ZEMBOWER <KZEMBOWE@jhuccp.or­g>>To: beginners@perl.org>­Subject: "Illegal seek" error?>Date: Wed, 09 Apr 2003 16:50:32 -0400>
The second line below is causing me some problems (the first line just >echos the command with the variables expanded):> print "cp -a $dirbase/$sitedir/$­_ $backupdir/$_\n" if $debug;> system "cp -a $dirbase/$sitedir/$­_ $backupdir/$_\n" or die "Can't copy >to $backupdir/$_: $!";>
When I run my program, I get this output:>cp -a /var/www/coreinitia­tive/htdocs/index.ht­ml >/var/www/disclaime­r-backup-20030409163­7/coreinitiative/htd­ocs/index.html>Can't­ copy to >/var/www/disclaime­r-backup-20030409163­7/coreinitiative/htd­ocs/index.html: >Illegal seek at ./exit_disclaimer.p­l line 112.>
I even changed the second line to:>system "echo -a $dirbase/$sitedir/$­_ $backupdir/$_\n" or die "Can't copy >to $backupdir/$_: $!";>
which doesn't try to do much of anything at all. Then, running the program >gives me:>-a /var/www/coreinitia­tive/htdocs/index.ht­ml >/var/www/disclaime­r-backup-20030409164­3/coreinitiative/htd­ocs/index.html>Can't­ copy to >/var/www/disclaime­r-backup-20030409164­3/coreinitiative/htd­ocs/index.html: >Illegal seek at ./exit_disclaimer.p­l line 112.>
The first line is the 'echo', the second is the 'die' clause working.>
I've tried using exec or backticks, with about the same result. Googling on >"Illegal seek" produced some notes about timing and pipes, but adding a >'sleep 1' after the cp didn't help either.>
Any guesses what's going wrong, and how to fix it?>
Thanks for your thoughts and suggestions.>
-Kevin Zembower>
----->E. Kevin Zembower>Unix Administrator>Johns­ Hopkins University/Center for Communications Programs>111 Market Place, Suite 310>Baltimore, MD 21202>410-659-6139>­
-->To unsubscribe, e-mail: beginners-unsubscri­be@perl.org>For additional commands, e-mail: beginners-help@perl­.org>


___________________­____________________­____________________­______
Tired of spam? Get advanced junk mail protection with MSN 8.
http://join.msn.com­/?page=features/junk­mail
Add comment
Kevin Zembower 11 April 2003 23:30:09 permanent link ]
 Thank you so much. I'll try to implement what you said on Monday, when I'm not so brain-dead. I suspected it might have to do with the exit status of the cp command, but I couldn't find in all my references what codes cp and other system commands use. So, "Illegal seek" was a complete red herring, huh?

Thanks, again.

-Kevin
Perl Median <perlmedian@hotmail­.com> 04/09/03 04:58PM >>>
you're using system the wrong way... system returns the exit status of the
command... most commands exit 0 on success so you will always die.

you need to change the way you die:

option 1: change that "or die" to "and die" but that might confuse others

option 2: check $? (also the exit status of the last command) if it is none
zero, then die.





From: KEVIN ZEMBOWER <KZEMBOWE@jhuccp.or­g>>To: beginners@perl.org >Subject: "Illegal seek" error?>Date: Wed, 09 Apr 2003 16:50:32 -0400>
The second line below is causing me some problems (the first line just >echos the command with the variables expanded):> print "cp -a $dirbase/$sitedir/$­_ $backupdir/$_\n" if $debug;> system "cp -a $dirbase/$sitedir/$­_ $backupdir/$_\n" or die "Can't copy >to $backupdir/$_: $!";>
When I run my program, I get this output:>cp -a /var/www/coreinitia­tive/htdocs/index.ht­ml >/var/www/disclaime­r-backup-20030409163­7/coreinitiative/htd­ocs/index.html>Can't­ copy to >/var/www/disclaime­r-backup-20030409163­7/coreinitiative/htd­ocs/index.html: >Illegal seek at ./exit_disclaimer.p­l line 112.>
I even changed the second line to:>system "echo -a $dirbase/$sitedir/$­_ $backupdir/$_\n" or die "Can't copy >to $backupdir/$_: $!";>
which doesn't try to do much of anything at all. Then, running the program >gives me:>-a /var/www/coreinitia­tive/htdocs/index.ht­ml >/var/www/disclaime­r-backup-20030409164­3/coreinitiative/htd­ocs/index.html>Can't­ copy to >/var/www/disclaime­r-backup-20030409164­3/coreinitiative/htd­ocs/index.html: >Illegal seek at ./exit_disclaimer.p­l line 112.>
The first line is the 'echo', the second is the 'die' clause working.>
I've tried using exec or backticks, with about the same result. Googling on >"Illegal seek" produced some notes about timing and pipes, but adding a >'sleep 1' after the cp didn't help either.>
Any guesses what's going wrong, and how to fix it?>
Thanks for your thoughts and suggestions.>
-Kevin Zembower>
----->E. Kevin Zembower>Unix Administrator>Johns­ Hopkins University/Center for Communications Programs>111 Market Place, Suite 310>Baltimore, MD 21202>410-659-6139>­
-->To unsubscribe, e-mail: beginners-unsubscri­be@perl.org >For additional commands, e-mail: beginners-help@perl­.org >


___________________­____________________­____________________­______
Tired of spam? Get advanced junk mail protection with MSN 8.
http://join.msn.com­/?page=features/junk­mail
Add comment
Rob Dixon 12 April 2003 01:17:10 permanent link ]
 Kevin Zembower wrote:> Thank you so much. I'll try to implement what you said on Monday, when I'm not so brain-dead.> I suspected it might have to do with the exit status of the cp command, but I couldn't find> in all my references what codes cp and other system commands use. So, "Illegal seek" was a> complete red herring, huh?

The system() command won't set $! for you - its value should be regarded as undefined.
In this case it happens to have the value 29 - 'Invalid seek'. The exit status of your 'cp'
command will be in $?. Take a look at

perldoc perlvar

HTH,

Rob
Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или законы РФ. Ваш ip-адрес записывается.


QAIX > Perl web-programming > "Illegal seek" error? 12 April 2003 01:17:10

see also:
Possible to email a Pivot/Query…
How to Print Very Large Fonts
Google comp.databases.ms-access
pass tests:
How objective you are
see also:
[Mac]How to edit photos with Photo…
How to rip and edit DVD(For Windows and…
How to convert dvd to popular video…

  Copyright © 2001—2010 QAIX
Идея: Монашёв Михаил.
Авторами текстов, изображений и видео, размещённых на этой странице, являются пользователи сайта.
See Help and FAQ in the community support.qaix.com.
Write in the community about the bugs you have noticedbugs.qaix.com.
Write your offers and comments in the communities suggest.qaix.com.
Information for parents.
Пишите нам на .
If you would like to report an abuse of our service, such as a spam message, please .
Если Вы хотите пожаловаться на содержимое этой страницы, пожалуйста .