Questions tagged [getfiles]

266 questions
2
votes
3 answers

VB.NET: GetFiles Method - "Access to the path 'G:\System Volume Information' is denied."

Here is my code, Dim allFiles As FileInfo() = tempDir.GetFiles("*.pdf", SearchOption.AllDirectories) I've googled and found that I need to change the permissions of my app from Project properties > View UAC Settings > and…
Bibhas Debnath
  • 14,559
  • 17
  • 68
  • 96
2
votes
2 answers

getFiles() not folders

I've got several files in a temporary folder. I can load them into Photoshop with scripting the following: var sourceFolder = Folder("C:\\temp"); if (sourceFolder != null) { var fileList = sourceFolder.getFiles(); } This is all good,…
Ghoul Fool
  • 6,249
  • 10
  • 67
  • 125
2
votes
1 answer

DirectoryInfo.GetFiles() is not returning all files on desktop(it excludes shortcuts)

I have a listBox1 that should display all the files on my desktop, i have used the following method to do so string filepath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); DirectoryInfo path = new DirectoryInfo(filepath); foreach…
John
  • 63
  • 1
  • 5
2
votes
1 answer

How to skip folders with unauthorized access while creating fileinfo list?

I have this for finding files and listing to list .but when it comes to a folder that needs authorized access, it stops. How can I make this skip those folders and carry on? string[] filetypes = new string[] { "3gp", "avi", "dat", "mp4", "wmv", …
emmett
  • 193
  • 2
  • 14
2
votes
2 answers

Turn comma-separated string into GetFiles SearchPattern

I have the following code: private string[] FindExistingDocuments() { string supportedImageFormats = "jpg,pdf,doc,docx,xlsx"; DirectoryInfo documentPath = new DirectoryInfo("..."); string supportedFileTypes = String.Join(",*.",…
Dumpen
  • 1,622
  • 6
  • 22
  • 36
2
votes
1 answer

can't find file created in dir returned by getFilesDir()

One part of my app needs to write a data file out. I use getFilesDir() and it gives me a path like this (after adding a file name): /data/data/com.casadelgato.zillaconfigdroid/files/Log.1378357559316.csv I create a PrintWriter to the file, write a…
CasaDelGato
  • 603
  • 7
  • 17
2
votes
1 answer

Populate Listbox with directory contents but only accept certain extensions

So, basically I drag in a folder onto the form, and a Listbox populates with the paths of the files inside. I've managed to make the Listbox accept only .MP3 paths, but how can I add more accepted extensions? Private Sub Form1_DragDrop(sender As…
Sarim Abbas
  • 33
  • 2
  • 2
  • 6
2
votes
1 answer

Is there a way to prompt for multiple file select and assign those files (and paths) to a variable?

Is there a way to prompt for multiple file select and assign those files (and paths) to a variable? For example, bring up a dialogue box that starts you in a base directory, and then allows you to assign files you select to different variables? …
Ben B.
  • 97
  • 3
  • 11
2
votes
3 answers

Powershell getfiles.count() to exclude thumbs.db

We have a script running daily that removes old files and directories from an area that people use to transfer data around. Everything works great except for one little section. I want to delete a folder if it's older than 7 days and it's empty.…
murisonc
  • 135
  • 1
  • 8
1
vote
2 answers

how can i write a file into an array based on the first part of the name and sort it by that?

The files are named as follows: 5000023_abc_2000045.pdf, 5000023_def_2000045.pdf. All files are in the same directory. I want to write all these files sorted into an array and then put them to a 3rd party program to merge them. It is about 60000…
aljoscha
  • 11
  • 5
1
vote
0 answers

Directory.GetFiles returns weird, non existant but existant files

I am currently working on a user-folder backup solution. At first I noticed the issue because I hat weird Documents in my backup such as: ZZZZZ2292124227.doc Upon further inspection, i found that Directory.GetFiles() returns these files. Files seem…
julian bechtold
  • 1,875
  • 2
  • 19
  • 49
1
vote
0 answers

.NET Directory.GetFiles() different behavior in different Windows Servers

GetFiles() return all files in Windows Server 2016 (and Windows 10) but in Windows Server 2019 returns only not zero byte files. At least i start to think that different server versions could be a source of such different behavior because there is…
SeniorSSS
  • 25
  • 6
1
vote
4 answers

How to output each file and folder in directory hierarchy

I'm looking for a way to all files and folders and files in those folders. As an example. if I have - Root + file1 + file2 -- Directory -+ file1 -+ file2 ---Directory --+ file1 --+ file2 I would like to be able to output each one of those files in…
Sandeep Bansal
  • 6,280
  • 17
  • 84
  • 126
1
vote
1 answer

Using Directory.EnumerateFiles()

I am iterating through a particular directory in my code using Directory.EnumerateFiles(). I only need the file name for each file present in the directory but number of files can be huge. As per MSDN and various other sources, we see it mentioned…
user3004790
  • 748
  • 7
  • 10
1
vote
0 answers

How can I call an xaml file from a folder in app shell?

I have a folder named jsonarray containing Page3.xaml . I want to show this page calling it from AppShell.xaml. The ordinary method calling in AppShell.xaml is: