Answers for "search file system for file java"

1

search file java

File dir = new File(directory);

File[] matches = dir.listFiles(new FilenameFilter()
{
  public boolean accept(File dir, String name)
  {
     return name.startsWith("temp") && name.endsWith(".txt");
  }
});
Posted by: Guest on March-27-2021
0

search for file in a whole system

import os

def search(drive,name):
    for dirpath, dirs, files in os.walk(drive):
        if name in files:
            return (os.path.join(dirpath, name))
Posted by: Guest on May-31-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language