Re: change all files names to lower case.

new topic     » goto parent     » topic index » view thread      » older message » newer message
sergelli said...

So, it worked. Does anyone have a better idea?

The only thing I'd change would be to test for when the double rename is necessary, then again the code posted seems to rename things that are already lowercase. Personally, I'd write a shim (completely untested):

procedure rename(sequence d, sequence oldname, sequence newname) 
    if not equal(newname,oldname) then 
        if equal(lower(oldname),lower(newname)) then 
            moveFile(d&oldname,d&oldname&'1') 
            oldname&='1' 
        end if 
        moveFile(d&oldname,d&newname) 
    end if 
end procedure 

Pete

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu