Gossamer Forum
Home : General : Perl Programming :

Can A Server do this?

Quote Reply
Can A Server do this?
For some reason my message board that I am using (Ikon Board, auction (Everyauction) are no writing to the files, but yet it says no error and it says it worked, and these have been working for a long time. And some of the scripts I've made that have worked before has stopped working since I moved to Liquid Web, is this the server problem? Links 2.0 works fine and writes to the file but I don't see why the others won't. My host has been no help and says it's the script's fault. Even though I checked the open(.....) and it is done correctly.
-------------
Jeremy
http://lc.crashinto.com - Crashinto Learning Central
Quote Reply
Re: [nolimit] Can A Server do this? In reply to
If data is not being written to files, then most likely you have a permission problem with your data files. Double check the permissions against the ones you set for the Links 2.0 database files.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [AnthroRules] Can A Server do this? In reply to
I put them at 666. Which is what my links ones are, but for some reason to I have to re chmod my links db files everyday, so I'll try rechmoding them and tell ya if it worked.
-------------
Jeremy
http://lc.crashinto.com - Crashinto Learning Central
Quote Reply
Re: [AnthroRules] Can A Server do this? In reply to
Ok that seemed to be it for writing to a file that exists, but it won't make the file if it isn't their. Just to make sure it's still open(.....) if you need it to create it right? Or is their another code I don't know yet that creates the file?
-------------
Jeremy
http://lc.crashinto.com - Crashinto Learning Central

Last edited by:

nolimit: Sep 29, 2001, 5:22 PM
Quote Reply
Re: [nolimit] Can A Server do this? In reply to
I use the following codes in my old flat file driven scripts:

Quote:

(-e $db_schedule_name) ?
open (ZL,">>$db_schedule_name") :
open (ZL,">$db_schedule_name");
flock(ID, 2) unless (!$db_use_flock);
$logline="$fields{'id'}\|$fields{'Sender'}\|$fields{'SenderEmail'}\|$fields{'Recipient'}\|$fields{'RecipEmail'}\|$fields{'Image'}\|$fields{'Greeting'}\|$fields{'Message'}\|$fields{'Goodbye'}\|$fields{'Day'}-$fields{'Month'}-$fields{'Year'}\|$fields{'Bgcolor'}\|$fields{'Text'}\n";
print ZL $logline;
close(ZL);

}


The -e switch checks to see if the file exists, and if doesn't then the file is created.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [AnthroRules] Can A Server do this? In reply to
Well that didn't do anything different, but should'nt if I just put open(FILE ">something.txt"); Shouldn't that just make the file?
-------------
Jeremy
http://lc.crashinto.com - Crashinto Learning Central
Quote Reply
Re: [AnthroRules] Can A Server do this? In reply to
This isn't necessary:

(-e $db_schedule_name) ?
open (ZL,">>$db_schedule_name") :
open (ZL,">$db_schedule_name");


open (ZL,">>$db_schedule_name") creates the file if it doesn't exist and appends if it does.
Quote Reply
Re: [RedRum] Can A Server do this? In reply to
I disagree, PAUL!
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [AnthroRules] Can A Server do this? In reply to
Fine, disagree, but errr I think you'll find it does what I said :)

Last edited by:

RedRum: Sep 29, 2001, 7:29 PM
Quote Reply
Re: [AnthroRules] Can A Server do this? In reply to
< = Read

> = Write, Create, Truncate

>> = Write, Append, Create

+< = Read, Write

+> = Read, Write, Create, Truncate

+>> = Read, Write, Append, Create

Perl for dummies is worth reading.

Last edited by:

RedRum: Sep 29, 2001, 7:35 PM
Quote Reply
Re: [AnthroRules] Can A Server do this? In reply to
Eliot, I'm not sure but doesn't this create a race condition:

Code:
(-e $db_schedule_name) ?
open (ZL,">>$db_schedule_name") :
open (ZL,">$db_schedule_name");

Just curious...

Later,
Paul

http://www.fullmoonshining.com for Pearl Jam Fans
Quote Reply
Re: [cranepaul] Can A Server do this? In reply to
Ok, I didn't mean to create an argument here. I knew what the <'s and stuff do, they just weren't creating the file so I want to make sure I was coding it right.
-------------
Jeremy
http://lc.crashinto.com - Crashinto Learning Central
Quote Reply
Re: [nolimit] Can A Server do this? In reply to
Well we don't know because we can't see it :)

It isn't an argument. I was just pointing out Eliot's mistake.
Quote Reply
Re: [RedRum] Can A Server do this? In reply to
Mistake! I don't think so, Paul!

Basically, the conditions set in the codes I provided do work and are not unnecessary.

Mistakes = non-functioning codes

Since the codes I provided DO FUNCTION, it is NOT a mistake...yes, there are different methods of writing codes...

Goodbye! Mad
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [AnthroRules] Can A Server do this? In reply to
I never once said the code didn't work, but yes the code is unnecessary.

If you are happy with it then great - it's no skin off my nose - I was just pointing out that you could make it much shorter.....I guess I won't try to help in future.
Quote Reply
Re: [RedRum] Can A Server do this? In reply to
Please don't.

Thank you.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [AnthroRules] Can A Server do this? In reply to
I wasn't calling out a mistake, only asking a simple question. I know your a great coder. I've seen code, like the section that I pointed out, that could lead to a race condition--where the test on the files existence may no longer valid by the time it tries to do an open on it. Sorry if I've offended you, I meant no harm. Not even a hint of constructive criticism on my part. I just wanted to hear, or rather see, your take on it. That's all. In the future I'll try not to ask any questions either. Questions = Aquired Knowledge, you learn I learn, we all learn something from it. Thanks, and sorry to be such a pain, but nobody's perfect.

Later,
Paul
http://www.fullmoonshining.com for Pearl Jam Fans
Quote Reply
Re: [cranepaul] Can A Server do this? In reply to
I was not replying to you...please look at the reply [Poster] section of posts/replies...I was replying to PaulWilson...RedRum, I mean.
========================================
Buh Bye!

Cheers,
Me