TecBrat Posted March 22, 2007 Share Posted March 22, 2007 I am working with a PERL script that writes pipe separated flat files as a DB. I am more comfortable writing in PHP. I want to be able to edit those files with my PHP scripts, but leave the PERL script that generated them, and edits them, in place. The PERL script is the core of the site. The PERL script uses flock to protect the files when the site gets busy enough that more than one request for a file may come at the same time. I am starting to think it's not compatiable at all, but I wanted to know if anyone has experience trying to make PHP obey an flock placed by PERL, or the other way around. Link to comment https://forums.phpfreaks.com/topic/43821-avoid-problems-with-perl-flocked-files/ Share on other sites More sharing options...
trq Posted March 22, 2007 Share Posted March 22, 2007 Can you explain what actually happens to these files when Perl has them flocked? Are the permissions changed? Link to comment https://forums.phpfreaks.com/topic/43821-avoid-problems-with-perl-flocked-files/#findComment-212726 Share on other sites More sharing options...
TecBrat Posted March 23, 2007 Author Share Posted March 23, 2007 Can you explain what actually happens to these files when Perl has them flocked? Are the permissions changed? No, it does not chmod the files, I think,(not really sure) that it's more of a "please don't touch that file" sort of thing and the next process has to be smart enough to ask "is that file locked?" before it starts using it. What I'm really unclear on is if the flock is part of perl or part of apache (or other server software) If it's part of apache, I wonder if I can use PHP to check for a Perl lock and vice versa. If it's done in the scripting language, maybe I can ... I'll stop myself here. Guess I need to just improve my Perl, then this won't be an issue. (I know there's a big debate on whether to code in PHP or Perl, I think I see a place for both, but just hate the idea of trying to remember, and keep separate in my mind, two sets of syntax.) Link to comment https://forums.phpfreaks.com/topic/43821-avoid-problems-with-perl-flocked-files/#findComment-213198 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.