file-search

How can I find the newest .pl file in a directory and all its subdirectories using Perl?

早过忘川 提交于 2019-12-01 19:47:38
How can I scan an entire directory's contents, including its subdirectories' contents, and find the newest .pl file within them using Perl? I want to build a sorted array/list of the full file paths of all .pl files within a directory tree. So, for example, if my base directory is /home/users/cheeseconqueso/ I want to search for .pl files in that directory and any subdirectory within that path and then sort the .pl files by date. The end result would be an array, @pl_paths , where $pl_paths[0] would be something like /home/users/cheeseconqueso/maybe_not_newest_directory/surely_newest_file.pl

How to get the last modified file in a directory using VBA in Excel 2010

为君一笑 提交于 2019-12-01 19:10:19
Im looking for a way to do this in Excel 2010 using VBA. It used to be possible in Excel 2003 using the Application.FileSearch method, but this has be depreciated. (see below) Dim sFileName As String sFileName = "" With Application.FileSearch .NewSearch .LookIn = sDir .Filename = "*.*" .Execute msoSortByLastModified, msoSortOrderDescending If .FoundFiles.Count > 0 Then sFileName = .FoundFiles(1) End With Any ideas how to do this in Excel 2010? Thanks If using the FileSystemObject is acceptable, you could use the method described here . To summarize: Dim fso As Scripting.FileSystemObject Dim

How to use DirectoryInfo.GetFiles and have it stop after finding the first match?

ε祈祈猫儿з 提交于 2019-12-01 07:31:08
Need to search the directory/sub-directories to find a file, would prefer it to stop once it has found one. Is this a feature built into DirectoryInfo.GetFiles that I am missing, or should I be using something else (self-implemented recursive search)? Use DirectoryInfo.EnumerateFiles() instead which is lazily returning the files (as opposed to GetFiles which is bringing the full file list into memory first) - you can add FirstOrDefault() to achieve what you want: var firstTextFile = new DirectoryInfo(someDirectory).EnumerateFiles("*.txt") .FirstOrDefault(); From MSDN: The EnumerateFiles and

How to use DirectoryInfo.GetFiles and have it stop after finding the first match?

假装没事ソ 提交于 2019-12-01 05:23:37
问题 Need to search the directory/sub-directories to find a file, would prefer it to stop once it has found one. Is this a feature built into DirectoryInfo.GetFiles that I am missing, or should I be using something else (self-implemented recursive search)? 回答1: Use DirectoryInfo.EnumerateFiles() instead which is lazily returning the files (as opposed to GetFiles which is bringing the full file list into memory first) - you can add FirstOrDefault() to achieve what you want: var firstTextFile = new

Recursive file search using C++ MFC?

不打扰是莪最后的温柔 提交于 2019-11-29 08:03:21
What is the cleanest way to recursively search for files using C++ and MFC? EDIT: Do any of these solutions offer the ability to use multiple filters through one pass? I guess with CFileFind I could filter on *.* and then write custom code to further filter into different file types. Does anything offer built-in multiple filters (ie. *.exe,*.dll)? EDIT2: Just realized an obvious assumption that I was making that makes my previous EDIT invalid. If I am trying to do a recursive search with CFileFind, I have to use *.* as my wildcard because otherwise subdirectories won't be matched and no

Eclipse Maven showing multiple paths for the same file

拥有回忆 提交于 2019-11-29 01:57:24
Is there any setting in Eclipse to show only the Maven project where the file resides? I have different Maven projects which are modules of a parent Maven project: projParent |-projWeb |-projModel |-projServices |-... If I look for a file using "Open Resource" (using Ctrl + Shift + r ) in Eclipse, it appears in many projects (E.g.: in projParent and in projWeb). Is there any way to show only relevant folder where that file is actually resided in? Try defining a Working Set that includes only the modules in which you want to search and then use that Working Set in the search. EDIT Actually I

Fuzzy file search in linux console

僤鯓⒐⒋嵵緔 提交于 2019-11-28 17:47:14
Does anybody know a way to perform a quick fuzzy search from linux console? Quite often I come accross situation when I need to find a file in a project but I don't remember the exact filename. In Sublime text editor I would press Ctrl-P and type a part of the name, which will produce a list of the files to select from. That's an amazing feature I'm quite happy with. The problem is that in most cases I have to browse a code in a console on remote machines via ssh. So I'm wondering is there a tool similar to "Go Anywhere" feature for Linux console? Junegunn Choi You may find fzf useful. It's a

Recursive File Search in .net

ぃ、小莉子 提交于 2019-11-28 06:26:11
I need to search a drive (C:, D: etc) for a partuicular file type (extension like .xml, .csv, .xls). How do I preform a recursive search to loop all directories and inner directories and return the full path of where the file(s) are? or where can I get information on this? VB.NET or C# Thanks Edit ~ I am running into some errors like unable to access system volume access denied etc. Does anyone know where I can see some smaple code on implementing a file search? I just need to search a selected drive and return the full path of the file type for all the files found. How about this? It avoids

Recursive file search using C++ MFC?

☆樱花仙子☆ 提交于 2019-11-28 01:54:37
问题 What is the cleanest way to recursively search for files using C++ and MFC? EDIT: Do any of these solutions offer the ability to use multiple filters through one pass? I guess with CFileFind I could filter on *.* and then write custom code to further filter into different file types. Does anything offer built-in multiple filters (ie. *.exe,*.dll)? EDIT2: Just realized an obvious assumption that I was making that makes my previous EDIT invalid. If I am trying to do a recursive search with

How to make eclipse “File Search” to also search inside source jars containing some text?

99封情书 提交于 2019-11-27 18:40:16
I am working on a (Java) project in which I have many jars which have a source-jar file attached. Is there any way to make the eclipse "File Search" search for Java files (and txt, xml etc. for that matter) containing some string literal inside these source jars, not just in the project folder? Or is there any plugin by which this can be achieved? user2757811 Recently discovered the following plugin has beta support for searching into linked source jars: https://github.com/ajermakovics/eclipse-instasearch You have to enable searching source jars in the preferences as it is turned off by