473,406 Members | 2,633 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,406 software developers and data experts.

find file by mask

hello one and all,

still new to java, day 12 now, but liking a bit more each day. how
would i do this in java.

say i want to see of the files of type "*.zip" in or under the directory
"/home/lucas". or, i want to see the file names of those with the
extension "zip" along with either their respective full or relative
paths to each of those files under that directory "/home/lucas".

what is the best method to do this in java? please provide a code
snippet as an example. thank you in advance and have a great easter
weekend.

lucas

Jul 17 '05 #1
1 9382
One way to do this is to use a java.io.FilenameFilter. The java.io
package offers many ways to interact with the file system. Real
Gagnon has posted an example use of a FilenameFilter:

http://www.rgagnon.com/javadetails/java-0055.html

Real has a lot of great coding examples on his site:

http://www.rgagnon.com/howto.html

HTH
- Glenn
slukacs <sl*****@adelphia.net> wrote in message news:<mr********************@adelphia.com>...
hello one and all,

still new to java, day 12 now, but liking a bit more each day. how
would i do this in java.

say i want to see of the files of type "*.zip" in or under the directory
"/home/lucas". or, i want to see the file names of those with the
extension "zip" along with either their respective full or relative
paths to each of those files under that directory "/home/lucas".

what is the best method to do this in java? please provide a code
snippet as an example. thank you in advance and have a great easter
weekend.

lucas

Jul 17 '05 #2

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

Similar topics

2
by: johnp | last post by:
Hi, Our Tech department updated users to Office 2003 this week. Now the input mask in one of the applications is showing up as: (###) ###-### The input mask wizard works correctly when I...
11
by: ex laguna | last post by:
How do I find the lowest bit position of a mask using only macros? I want to do everything in compile time. That mean, there cannot be control statements such as if, while, for, etc. in the...
10
by: LuTHieR | last post by:
Hi, I'm reading a string of numbers from a file (using Borland C++ Builder 6), and I'm doing it like this: first I use FileRead to store all the data in the file to a char* variable (appropriately...
5
by: Oyvind Eriksen | last post by:
Hello. I need to read bits from bytes in a file. I have code that works but it's very slow. Can anybody help me? The code I have is: private bool GetBit(byte b, int pos) { return ((b &...
5
by: Denis Petronenko | last post by:
Hello, how can i read into strings from ifstream? file contains values in following format: value11; val ue12; value 13; valu e21;value22; value23; etc. i need to read like file >string,...
6
by: kai rosenthal | last post by:
Hello, with ls -l on windows I get -rw-r--r-- 1 500 everyone 320 Nov 09 09:35 myfile How can I get on windows with a standard python 2.2 (without windows extensions) the information "500" and...
3
by: John Williams | last post by:
I'm writing a stagenography program to experiment with how it works. The algorithm I'm using appears to be producing the correct result...however I'm struggling with the file input. I never...
4
by: mitymouse | last post by:
I am fairly familiar with scripting dos commands and that's about it. I remember some syntax and whatnot from a few programming classes I've taken but I don't remember any of the modules or functions...
0
by: stainless | last post by:
I know this is not necessarily a C# question but the code I am wrinting is C# and I wasn't sure whereelse to ask the question. I have taken some web code (from codeproject.com) that performs FTP...
1
by: Don Gollahon | last post by:
How can I find a file in .NET? I know I can use Directory.GetFiles() with a path and mask like '*.txt' but our directories in production can have 10's of thousands of files. I just want to get...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.