In another thread, I think someone is asking how (not why)
to delete empty subfolders.

I think the following may be a good answer
and it works when tested here

but I don't want to confuse him with one of my horrible mistakes
so I'd like someone else to check it for me please
Bruce? Sean? Mockey? Nelson Mandela?


command .DelEmptyFolders("c:\windows\temp")

;;----------- DelEmptyFolders.powerpro ------

file.allfiles(arg(1),"[EMAIL PROTECTED](_file_)",5)
quit

@sub
if(not file.listfiles(arg(1),1))
  file.delete(arg(1))
quit

;;---------------------------------------

Or, because arg(1) means different things in different places,
maybe this looks more friendly and less confusing:

;;-------------------------------------

parentfolder = arg(1)
file.allfiles(parentfolder,"[EMAIL PROTECTED](_file_)",5)
quit

@sub
subfolder = arg(1)
if(not file.listfiles(subfolder,1))
  file.delete(subfolder)
quit

;;-------------------------------------------

Can it be done more neatly without a subroutine?

Thanks
Alan



------------------------ Yahoo! Groups Sponsor --------------------~--> 
See what's inside the new Yahoo! Groups email.
http://us.click.yahoo.com/2pRQfA/bOaOAA/yQLSAA/JV_rlB/TM
--------------------------------------------------------------------~-> 

Attention: PowerPro's Web site has moved: http://www.ppro.org 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to