On Thu, Nov 19, 2009 at 1:45 PM, Sadnem <sad...@gmx.com> wrote:
> P Kishor wrote:
>> On Thu, Nov 19, 2009 at 12:58 PM, Sadnem <sad...@gmx.com> wrote:
>>
>>> how could i make a script that would keep watching a sqlite table and
>>> cheking to delete folders marked with status 0? this is an example of
>>> the database i'm talking about -->
>>> http://www.wikifortio.com/834317/example.sqlite
>>> Note that the folder name is exactly the same as the one under "Release"
>>> and that these folders wont be located on the same directory of the
>>> database.
>>>
>>
>> Make a script in what? Not sure what you are asking but, from what I
>> understand, the following pseudocode should do it --
>>
>> WHILE: while true
>>    SELECT: select folder_name from table where status = 0
>>    LOOP: loop over SELECT
>>        unlink folder_name
>>    end LOOP
>> end WHILE
>>
>> the exact implementation will depend on the scripting language you are using.
>>
>>
>>> Thanks.
>>> Regards, Pedro.
>>> _______________________________________________
>>> sqlite-users mailing list
>>> sqlite-users@sqlite.org
>>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>>
>>>
>>
>>
>>
>>
> Well, I'm configuring my server to Download some folders to it and then
> to upload them to another web and i was wondering how could i delete
> that folders from the hdd once they were completely uploaded (thats when
> the folder get marked with a 0 status) my problem is that i haven't made
> all the code I'm using to do that and the infoabout the status of the
> upload is stored in a sqlite database but my sqlite knowledge is null, I
> hope you can understand it now.

I don't think you need much sqlite knowledge to accomplish... you just
need a SELECT statement. What you do need is a good knowledge of your
scripting environment so you don't willy nilly delete wrong folders.
Make your script, then test it out with fake entries and folders, and
then when you are sure, test it out again.


> Thanks.
> Regards, Pedro
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
Puneet Kishor http://www.punkish.org
Carbon Model http://carbonmodel.org
Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
Nelson Institute, UW-Madison http://www.nelson.wisc.edu
-----------------------------------------------------------------------
Assertions are politics; backing up assertions with evidence is science
=======================================================================
Sent from Madison, Wisconsin, United States
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to