473,322 Members | 1,718 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,322 software developers and data experts.

How not to get hidden files :-)

Hi,

I am trying to get file listing that would ignore hidden files and folders.
But using the Directory.GetFiles method seems to get all files and folders
in the specified path irrespective of their hidden status. Any ideas or help
would be appreciated.

Thanks,
Saranjit
Nov 19 '05 #1
3 8633
"Saranjit Singh" <sa*******@grapecity.com> wrote in message
news:uJ**************@TK2MSFTNGP11.phx.gbl...
Hi,

I am trying to get file listing that would ignore hidden files and folders. But using the Directory.GetFiles method seems to get all files and folders
in the specified path irrespective of their hidden status. Any ideas or help would be appreciated.

Thanks,
Saranjit


There *may* be a way to automate it, but you could definitly look at the
attributes of each file and preform a manual filter.

HTH,
Jeremy

Nov 19 '05 #2
I could and I did try it out. The only problem is that the directory I am
searching has some 100,000 files or so. Getting the directory listing itself
takes quite a bit of time (especially so since it's not on the local
machine), so maybe if there's a way to filter the listing in the call to
some .NET Framework function ... looping and checking the attributes would
be too much in this case I guess.

And I would have to make quite a bit of changes to the application if
whatever method is suggested does not return the filenames as a string array
as the Directory.GetFiles method :-(
Nov 19 '05 #3
"Saranjit Singh" <sa*******@grapecity.com> schrieb
I am trying to get file listing that would ignore hidden files and
folders. But using the Directory.GetFiles method seems to get all
files and folders in the specified path irrespective of their hidden
status. Any ideas or help would be appreciated.

I don't think there is a built-in filter. If you'd use
System.IO.DirectoryInfo.GetFiles, you'd get FileInfo objects and could check
their attributes property without calling System.IO.File.GetAttributes on
each file.
--
Armin

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: lawrence | last post by:
Can anyone tell me why this code works in Netscape 7.1 but not in IE??? <SCRIPT type='text/javascript'> function makeVisible(nameOfDiv) {...
1
by: dixie | last post by:
I am trying to delete the temporary files that MS Word leaves behind sometimes when it fails to clean up properly. Files like ~$lename.dot. I have used the Kill command, but find that this...
4
by: Greg Bell | last post by:
Hi, Can someone tell me where to look to enable me to read "Folder Options" user settings for hidden/system files from within C#/VB.Net/Any other .NET language. I'm pretty sure it must be part...
3
by: Dale | last post by:
Is there a way to determine the number of hidden files/directories within a directory? This is what I’m doing now: System.IO.DirectoryInfo rootPath; System.IO.FileSystemInfo dirs, files; int...
3
by: Christian Blackburn | last post by:
Hi Gang, All I want is to be able to search a file for files matching a certain criteria. However, VB seems heart set on returning hidden folders along with my list of files. I've tried the...
1
by: Lenny G. | last post by:
What's the best way to do cross-platform hidden file detection? I want to do something like weed-out the files that should be 'hidden' from os.listdir() (which would be files that start with '.'...
5
by: pbd22 | last post by:
hi. i have a hidden iframe for uploading files. when i check the httpfilecollection on the server, it is always zero - the files never make it to the server. i know all the javascript is working...
5
by: akmsikhan | last post by:
I am using a Toshiba Satellite M115 Series Laptop. Recently I was trying to see some hidden files but I can't. When I try to enable Show Hidden Files and Folder it is not enabling. Each time I click...
5
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
I have a .Net web service that converts the MODCA files to tif or png file format. This web service runs on a 2003 server. This web service first copies the MODCA file to be converted to a...
4
by: virtualweb | last post by:
Not able to pass variables data: Hello .. Im building a form that uploads files with encType="multipart/form-data" but on the same form I need to pass other variables with hidden fields. The...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.