dir /b produces a nice file-only list
dir /x produces a detailed listing (date, time, size, longname, shortname)
if you combine the two (i. e. dir /b /x) the /x switch gets ignored. this behavior as per this page is by design.
so if you ask for a simple list containing only of shortnames of files, redmont says it is against the rules ...
The directory 'C:\temp' has two files named 'GZ96A7005.tif' and 'GZ96A7005001.tif'. They have different length with the same extension. Now I run below code:
string[] resultFileNames = Directory.GetFiles(@"C:\temp", "????????????.tif");
The 'resultFileNames' return two items 'c:\temp\GZ96A7005.tif' and 'c:\temp\GZ96A7005001.tif'.
But ...
private string[] ColeccionDeCortes(string Path)
{
DirectoryInfo X = new DirectoryInfo(Path);
FileInfo[] listaDeArchivos = X.GetFiles();
string[] Coleccion;
foreach (FileInfo FI in listaDeArchivos)
{
//Add the FI.Name to the Coleccion[] array,
...
I have part of a build process that creates a hideously long path in Windows. It's not my fault. It's several directories deep, and none of the directory names are abnormally long; they're just long and numerous enough to make it over MAX_PATH (260 chars). I'm not using anything other than ASCII in these names.
The big problem is that t...
I am using a SaveFileDialog and have to set long string(longFileName) in FileName. String longFileName is known at Runtime.
If I set
saveFileDialog.FileName = longFileName ;
then I get System.IO.PathTooLongException.
How can I do it?
...
From Java, I'm extracting an executable into a location specified using File.createTempFile(). When I try to run my executable, my program hangs when it tries to read the first line of output.
I have discovered that if I try to run the same extracted executable from another program, it works if I specify the directory as C:\Documents a...
I'm looking at handling longer file paths in my windows application.
Currently, I have a text box (edit box) in which a user can type an absolute file path. I then read that typed file path, using GetWindowText, into a string declared like so: TCHAR FilePath[MAX_PATH];
Obviously, here i'm relying on the MAX_PATH constant which limits m...