[pLog-svn] r5210 - plog/branches/lifetype-1.2/class/file
Oscar Renalias
oscar at renalias.net
Wed Mar 28 18:19:55 EDT 2007
Is this issue related to this?
http://forums.lifetype.net/viewtopic.php?t=6212
Oscar
On 28 Mar 2007, at 21:48, Mark Wu wrote:
> Hi Jon:
>
> Thanks, if you have time, please kindly go ahead.
>
> This error message looks like "unlink errror in ./tmp/sql_error.log,
> permission denied" only happened when I execute the wizard in
> upgrade mode.
> And set the resources naming rule to encode_file_name. (you can try
> upgrade
> from 1.2 to 1.2 for testing purpose)
>
> I spent several hours to trace the error, but the code looks okay.
> So, I
> really have no idea what's going on.
>
> I guess the logger access the sql_error.log at that time and locked
> the
> file, it just cause file::delete() failed.
>
> I only can confirm the error exist under windows. (Because my
> development
> environment is windows)
>
> I have no idea the same error exist in linux or not.
>
> So, I just use '@' to hide them first.
>
> Mark
>
>> -----Original Message-----
>> From: plog-svn-bounces at devel.lifetype.net
>> [mailto:plog-svn-bounces at devel.lifetype.net] On Behalf Of Jon Daley
>> Sent: Thursday, March 29, 2007 2:33 AM
>> To: plog-svn at devel.lifetype.net
>> Subject: Re: [pLog-svn] r5210 - plog/branches/lifetype-1.2/class/file
>>
>> I think something is going on that we don't understand and
>> adding the @ is just hiding it.
>>
>> Do we need a check to see if we are getting a "." or ".."? I
>> think we probably don't, but that's how you'd do it in C on Windows.
>>
>> I can look into this more, and do some debugging on it to see
>> if I can track it down.
>>
>> A separate question:
>> What is $onlyFiles supposed to do? The documentation says it
>> won't delete the top-level folder, but all subdirectories
>> will be deleted. This is not what it does (at least from
>> reading the code). I think the recursive call to
>> File::deleteDir should have $onlyFiles always set to false to
>> achieve this behavior.
>>
>>
>>
>> On Wed, 28 Mar 2007, mark at devel.lifetype.net wrote:
>>
>>> Author: mark
>>> Date: 2007-03-28 12:50:56 -0400 (Wed, 28 Mar 2007) New
>> Revision: 5210
>>>
>>> Modified:
>>> plog/branches/lifetype-1.2/class/file/file.class.php
>>> Log:
>>> Weird! the error message still there. Revert the last
>> modification in svn rev 5209. And add @ before unlink and
>> rmdir to avoid annoying error messages.
>>>
>>> Modified: plog/branches/lifetype-1.2/class/file/file.class.php
>>> ===================================================================
>>> --- plog/branches/lifetype-1.2/class/file/file.class.php
>> 2007-03-28 14:15:40 UTC (rev 5209)
>>> +++ plog/branches/lifetype-1.2/class/file/file.class.php
>> 2007-03-28 16:50:56 UTC (rev 5210)
>>> @@ -224,9 +224,9 @@
>>> return false;
>>>
>>> if( File::isDir( $file ))
>>> - $result = rmdir( $file );
>>> + $result = @rmdir( $file );
>>> else
>>> - $result = unlink( $file );
>>> + $result = @unlink( $file );
>>>
>>> return $result;
>>> }
>>> @@ -272,13 +272,12 @@
>>>
>> File::deleteDir( $file, $recursive, $onlyFiles, $excludedFiles );
>>> }
>>> }
>>> - else {
>>> - // check if the
>> filename is in the list of files we must not delete
>>> -
>> if(array_search(basename( $file ), $excludedFiles) === false) {
>>> - // File::delete can
>> remove empty folders as well as files
>>> - if(
>> File::isReadable( $file )) {
>>> -
>> File::delete( $file );
>>> - }
>>> +
>>> + // check if the filename is in
>> the list of files we must not delete
>>> + if(array_search(basename( $file
>> ), $excludedFiles) === false) {
>>> + // File::delete can remove
>> empty folders as well as files
>>> + if( File::isReadable( $file )) {
>>> + File::delete( $file );
>>> }
>>> }
>>> }
>>>
>>> _______________________________________________
>>> pLog-svn mailing list
>>> pLog-svn at devel.lifetype.net
>>> http://limedaley.com/mailman/listinfo/plog-svn
>>>
>>
>> --
>> Jon Daley
>> http://jon.limedaley.com/
>>
>> The church is consciously inadequate persons who gather
>> because they are weak, and scatter to serve because unity
>> with each other and Christ has made them bold.
>> -- Elton Trueblood
>> _______________________________________________
>> pLog-svn mailing list
>> pLog-svn at devel.lifetype.net
>> http://limedaley.com/mailman/listinfo/plog-svn
>>
>
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://limedaley.com/mailman/listinfo/plog-svn
>
More information about the pLog-svn
mailing list