Hm. What is this escape sequence: \*?
Hm. What is this escape sequence: \*?
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
Originally Posted by Dave_Sinkula
It's not an escape sequence it is the MSDOS folder seperator as in:-
C:\DOCUME~1\HP_OWNER\DESKTOP\TESTDIR\2E6D1\196135~ 1.LOG
I want to list all the ".log" files so I want *.log
So the last bit would become:-
C:\DOCUME~1\HP_OWNER\DESKTOP\TESTDIR\2E6D1\*.LOG
Of course when I was printing the stuff into a string with sprint I had to do something like
Code:sprintf (asrting, "C:\\DOCUME~1\\HP_OWNER\\DESKTOP\\TESTDIR\\2E6D1\\*.LOG")
(or something like that, it just an example)
You can see in the above the long filenames have been truncated.
Anyway.... I have though of a 'work around' in the meantime. What I can do is just rename all the folders to short filenames and then work with them. This is OK because I actually want to rename the folders anyway, based on the date of the files within them, thus if the files are dated 09/09/2006 (todays date) the folder will be named "09092006". This will meet my needs for what I want to do, however I would still like to know how to 'solve' the original problem.
Now I just need to find a good folder renaming utiliity, any recommendations?
If you append a /X onto your dir, it will show you both the short and long filename. Last time I did something like this (in another language), I just wrote up a short bat file with all the various dir options I wanted (it has quite a list, type dir /? to see them all), and had it's output go into my program's input.I want to list all the ".log" files so I want *.log
Renaming lots of files is a poor idea, imo. Learn to work with your OS, not work around it.
Adak
Last edited by Adak; 09-08-2006 at 08:33 PM.
Yes, I knew that. The same as I know a forward slash is easier to work with.Originally Posted by esbo
Perhaps the MSDN has something about converting long filenames to short filenames?
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
Talking of which, do these functions "take" forward slashes as back slashes in a Windows environment?Originally Posted by Dave_Sinkula
Just occured to me I've never tried and have been at the hands of \\ for years.
Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.
- Mike McShaffry
http://groups.google.com/group/comp....3ac81f37b60ca9Originally Posted by ahluka
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*