473,396 Members | 1,783 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Is folder empty ??

1
How can we find whether the folder is empty or not ??
Is there a single function for it, provided by c++ library ??
Jul 31 '06 #1
2 5471
How can we find whether the folder is empty or not ??
Is there a single function for it, provided by c++ library ??

Hi,
U can use the function FindFirstFile( ); which will try to find the first file present in the given folder n if the folder is empty then this function will fail.
Jul 31 '06 #2
Banfa
9,065 Expert Mod 8TB
No folder is empty every folder always contains the directories

.
..

that is dot and dot dot representing the current folder and the folder 1 level down in the directory structure. remembering that directories are just a special type of file.

You may be able to tell FindFirstFile to ignore directory files or you may have to read the contents of the directory and ignore these 2 entries.
Jul 31 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: atse | last post by:
Hi, How can I know whether a folder is empty using FileSystemObject? Thanks. Atse
2
by: atse | last post by:
Hi, I still don't know how to determine a empty folder. Can you tell me more detail? thanks Atse "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message...
1
by: Keith | last post by:
I have a script which allows a user to upload and delete files from the server. Is it possible (and if so how) to do a check to see if the folder is empty (ie if the last file in a particular...
5
by: Lucas Ponzo | last post by:
I have the following directory structure: \images \other_images\images There is duplicate names, but at diferent levels. But the Visual Studio Setup Project emits the error: Unable to...
13
by: could ildg | last post by:
I want to check if a folder named "foldername" is empty. I use os.listdir(foldername)== to do this, but it will be very slow if the folder has a lot of sub-files. Is there any efficient ways to do...
1
by: Pmcg | last post by:
Hi, I've been using Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) to get the application data folder for ASP.Net applications using IIS5.0 where it works for both the...
6
by: lumpybanana247 | last post by:
anybody know how i could delete a FOLDER in c++? i know to delete a file is #include <iostream> #include <fstream> using namespace std; /* remove example: remove myfile.txt */
24
by: biganthony via AccessMonster.com | last post by:
Hi, I have the following code to select a folder and then delete it. I keep getting a Path/File error on the line that deletes the actual folder. The line before that line deletes the files in...
1
by: Larry Bates | last post by:
I have a need to implement a drop folder upload mechanism for secure uploading of files to a server. At first glance this appears that it would be an easy application to write. Then I begin to...
5
by: fniles | last post by:
I am using VB.NET 2005. When I try to delete a folder that has files underneath it, it gave me "the directory is not empty" error. f = New IO.DirectoryInfo("C:\myfolder") If f.Exists Then...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.