How to check if folder doesn't contain any other

7 posts in this topic

eJan 0

I'm trying to make script which will check if "@AppDataCommonDir (\001)" doesn't contain any file or subfolder except "\001" which contain files and subfolders inside and delete @AppDataCommonDir if no other files or folders exists.

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post

Link to post

Share on other sites

eJan 0

Thanks Kurt, but I couldn't get it to work, this is what it looks like:

My point is to extract files B:\Documents and Settings\All Users\Application Data\001 to RamDrive, to use files for some time then delete 001 and @AppDataCommonDir if any other folder or file doesn't exist inside @AppDataCommonDir. On RamDrive @AppDataCommonDir doesn't exist by default.

Share this post

Link to post

Share on other sites

/dev/null 0

what exactly does not work? My code checks if @AppDataCommonDir holds only \001. If so, the variable $empty will be set to 1. If there is anything else in @AppDataCommonDir, then the variable will be set to 0. You will have to write your own code to delte or copy files based on that information.

BTW: The screenshot does not match your textual description. Is that intentional?

Cheers

Kurt

Edited June 11, 2005 by /dev/null

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post

Link to post

Share on other sites

eJan 0

what exactly does not work? My code checks if @AppDataCommonDir holds only \001. If so, the variable $empty will be set to 1. If there is anything else in @AppDataCommonDir, then the variable will be set to 0. You will have to write your own code to delte or copy files based on that information.