Questions tagged [getfiles]

266 questions
2
votes
2 answers

What is the fastest\best way to get file names from a folder using PowerShell?

The directory has 20k folders in it. In these folders there are subfolders and some files. I don't need to look into the subfolders. I need to get all the files with .EIA extension from the folders. I know I could use Get-Item, Get-ChildItem for…
Brute
  • 33
  • 5
2
votes
4 answers

C# - Exclude directories and files from Directory.GetDirectories() and Directory.GetFiles()

I need to count files and directories inside a specified directory path. But I want to exclude .git folder and files inside this folder from being counted. I tried - int maxCount = Directory.GetFiles(loadedDirectoryPath, "*.*",…
Tanmay Bairagi
  • 564
  • 5
  • 25
2
votes
0 answers

Unexpected behaviour when searching for available pipes

We are using the GetFiles approach from this question like this: var pipePrefix = "Test_"; Directory.GetFiles("\\.\pipe\", pipePrefix + "*"); And we are looking for pipes like "Test_1", "Test_2", "Test_3". We know that this apporach has some issues…
0lli.rocks
  • 1,027
  • 1
  • 18
  • 31
2
votes
2 answers

How to exclude certain files while using GetFiles()

I have a Folder containing 2 subfolders each containing around 1000 files. The files look like this: 38485303_SARA_N211_T.ygx 38485303_SARA_N211_B.ygx 38208001_ULTI_CARTRI.ygx I want 3 separate arrays - 2 of which I already have. Array 1…
Denzel Obispo
  • 101
  • 1
  • 9
2
votes
2 answers

System.IO.Directory.GetFiles() doesn't list all files

I am using the System.IO.Directory.GetFiles() function to list all executable files from C:\Windows\System32 with the following code: using System; using System.Collections.Generic; using System.IO; namespace MyProgram { class Program { …
E235
  • 11,560
  • 24
  • 91
  • 141
2
votes
1 answer

Limiting the amount of files grabbed from system.io.directory.getfiles

I've got a folder browser dialogue populating the directory location (path) of a system.io.directory.getfiles. The issue is if you accidentally select a folder with hundereds or thousands of files (which there's no reason you would ever need this…
JHopland
  • 23
  • 5
2
votes
1 answer

How to refresh System.IO.DirectoryInfo.GetFiles().Length

I'm having trouble with getting the uptodate amount of files in a directory. The files are being printed from PDFCreator and being sent to that folder. When the number of files in the folder match the number of files being printed it should then…
Mutley
  • 77
  • 2
  • 13
2
votes
0 answers

How to skip scan System Volume Information folder on C#

Help, how to skip folder System Volume Information on disk D with C# and scan another folder.. here's the sample code public void scDirectory(string location, string password) { var validExtensions = new[] { ".ogg", ".mp3", ".txt" …
All Oners
  • 21
  • 1
2
votes
1 answer

How to custom sort the return values of Directory.GetFiles()

I am loading a list of files placed in a directory in a string array. I am using System.IO.Directory.GetFiles(), String[] path = Directory.GetFiles(batchElements[j].DocIdPath, "*.csv", SearchOption.AllDirectories); I'm assuming the default sort…
Maverick
  • 1,396
  • 5
  • 22
  • 42
2
votes
1 answer

vb.net Exclude extension from "GetFiles"

I'm currently adding all found documents in a directory and sub-directory into a listbox. This works perfectly, for my need, but i'm getting too much unwanted files. The code for adding the files into my…
JefE
  • 137
  • 1
  • 2
  • 12
2
votes
1 answer

Why doesn't the relative protocol work in a local file?

I have an index.html file in the desktop and I would like to get jQuery library with these options: I don't want to upload index.html file to server I don't want to add protocol for get jquery script. The script must be retrieved from jQuery CDN…
InBug
  • 43
  • 1
  • 9
2
votes
2 answers

Is there a way to get a file from res folder with ClassLoader and getClass() method

I have the loadImage function for getting images. It only does not work when I am trying to get the file from the getFile() function. public BufferedImage loadImage(String img) { BufferedImage bimg = null; try { bimg =…
8803286
  • 81
  • 2
  • 10
2
votes
2 answers

Walking through directory while controling depth - C#

I need to be able to get all files from a directory and sub directories, but I would like to give the user the option to choose the depth of sub-directories. I.e., not just current directory or all directories, but he should be able to choose a…
DaveyD
  • 337
  • 1
  • 5
  • 15
2
votes
1 answer

How to prevent Directory.GetFiles to "check" recycle bin and other "unsafe" places?

So guys, I have a function in my application which to search for certain file in certain directory using GetFiles method System.IO.Directory.GetFiles(string path, string searchPattern, System.IO.SearchOption) It works fine, until when I choose…
Moses Aprico
  • 1,951
  • 5
  • 30
  • 53
2
votes
1 answer

File Not Found - File System API, Javascript

Using a local Apache web server for testing, with Chrome (33) and a very basic piece of code function onInitFs(fs) { fs.root.getFile("productinfo.xml", {}, function(fileEntry) { fileEntry.file(function(file) { var reader =…