Questions tagged [filesysteminfo]

13 questions
2
votes
5 answers

Sort FileSystemInfo[] by Name

I have probably spent about 500 hours Googling this and reading MSDN documentation and it still refuses to work the way I want. I can sort by name for files like this: 01.png 02.png 03.png 04.png I.e. all the same file length. The second there is a…
ツ.jp
  • 315
  • 5
  • 22
2
votes
8 answers

How can I get a full path of a given path (can be a directory or file, or even full path) using C#?

The closest I get is using new FileInfo(path).FullPath, but as far as I know FileInfo is for files only, not directory. See also my comments to Jon Skeet's answer here for context.
Louis Rhys
  • 34,517
  • 56
  • 153
  • 221
2
votes
1 answer

Copy File to another Folder Structure

I am currently trying to create a program, that should copy a folder structure into a directory. Here is an example: C:\test1\folder\folder\file.txt should end up in C:\test2\folder\folder\file.txt I have a List
Snickbrack
  • 1,253
  • 4
  • 21
  • 56
2
votes
1 answer

DirectoryInfo().GetFileSystemInfos() - how to avoid hidden folders?

If I do this: var entries = new DirectoryInfo(@"C:\Folder1") .GetFileSystemInfos("test*", SearchOption.AllDirectories); when I have a folder structure like this, where the "HiddenFolder" is hidden but the "test.txt" file is not…
Glen Little
  • 6,951
  • 4
  • 46
  • 68
1
vote
2 answers

Can statfs() read a remote FTP drive?

I am mounting a remote network drive using FTP. When I do a statfs() on it, I get a -1. So I wanted to know Can statfs() read a remote network drive mounted using FTP? If not then how else can I get information (size, free space available) about…
Satya Sidhu
  • 103
  • 1
  • 9
1
vote
3 answers

C# Directory does not exist error when it does exist

As title explains, I have a program that checks if a directory exists before continuing. And when the check is made it, it says the directory doesn't exist when it does! Here's the code for storing the directory path: string currentDirectory =…
Sulaiman
  • 147
  • 4
  • 11
0
votes
0 answers

How to efficiently retrieve a list of file names and lengths

I have a C# application where at one point it scans a folder that could potentially contain 10s of thousands of files. It the filters that list by name and length and selects a relatively small number for processing. Simplified code: DirectoryInfo…
T N
  • 4,322
  • 1
  • 5
  • 18
0
votes
1 answer

i want to get my dir. info into an Multidimensional Array - PHP

I had it in an array and it worked fine now I want to insert it in a Multidimensional Array. This is my code, not sure what I am doing or if even its poasable, I want that the getFilename() should be assigned to a key, Thanks for any help! …
Peneh
  • 195
  • 1
  • 10
0
votes
1 answer

In VB6, how to access FileSystem.GetFileInfo()?

Throwback on an old project and needing to use VB6. I'm having an issue in referencing the appropriate DLL that contains System.IO in the old VB6 IDE. I have tried to reference: C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll - error: …
ElHaix
  • 12,846
  • 27
  • 115
  • 203
0
votes
0 answers

How to detect the sorting order of files in a folder using C#

I know how to get files/enumerate files from a directory. I also know how to sort them with an arbitrary sorting order using DirectoryInfo.getFileSystemInfos and Linq queries. The problem is I want to detect the actual sorting order in…
codebro
  • 25
  • 9
0
votes
1 answer

Missing directory and file info

The following is not returning a full list of files and directories: IEnumerable files = new DirectoryInfo("C:\\Windows\\System32\\drivers").EnumerateFileSystemInfos("*", SearchOption.AllDirectories); The application is run as a…
0
votes
1 answer

Batch to get systeminfo for Multi remote windows servers

I'm trying to make a batch file to run the systeminfo command. I am using this command for one server and it's working but I need for multiple servers. SYSTEMINFO /S ServerName /U My_Domain\my_domain_account /p my_password >C:\Systeminfo.txt I…
rozbeh85
  • 37
  • 2
  • 3
  • 7
0
votes
4 answers

Batch - trying to obtain the detail of systeminfo.exe

Like the results of this.. SYSTEMINFO >> RESULTS.TXT Systeminfo | find "Network Card" However, this only captures the first line entry: Network Card(s): 2 NIC(s) Installed. What I would really like to see is: Network Card(s): 2…
Leptonator
  • 3,379
  • 2
  • 38
  • 51