> --- Ursprüngliche Nachricht ---
> Von: "Richard Coffre" <[EMAIL PROTECTED]>
> An: [email protected]
> Betreff: [scite] How to set bak files ?
> Datum: Mon, 27 Mar 2006 11:36:14 +0200
> 
> Hi all,
> 
> Is it possible to define or set bak files in order to have a backup ?
> 
> Thanks in advance

anyone in this group have created a php-edition of Scite which includes a
lua-script for doing this automatically (i think its taken from the
autoit-project). Here a snippet:

base.lua (in scite-directory):
function OnBeforeSave(filename)
        local sbck = tonumber(props['backup.files'])
        -- no backup specified
        if sbck == nil or sbck == 0 then
                return false
        end
        local nbck = 1
        while (sbck > nbck ) do
                local fn1 = sbck-nbck 
                local fn2 = sbck-nbck+1 
                os.remove (filename.. "." .. fn2 .. ".bak")
                if fn1 == 1 then
                        os.rename (filename .. ".bak", filename .. "." .. fn2 
.. ".bak")
                else
                        os.rename (filename .. "." .. fn1 .. ".bak", filename 
.. "." .. fn2 ..
".bak")
                end
                nbck = nbck + 1
        end
        os.remove (filename.. "." .. ".bak")
        os.rename (filename, filename .. ".bak")
        return false
end

Sciteuser.properties:
extension.*=$(SciteDefaultHome)\base.lua
#define the number of backup files you want to keep   0=none
backup.files=1

every time you save, backupfiles (how many you defined) are created
(alternatively renamed).

Hope that helps
Frank

-- 
Echte DSL-Flatrate dauerhaft für 0,- Euro*!
"Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl
_______________________________________________
Scite-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scite-interest

Reply via email to