P
Pegboy
I am trying to create a DOS utility that will extract data from a file and
use it to form a new filename for that same file. I can successfully open
the file, get the data I need and form the new name, but it truncates and
renames it in the 8.3 format. If the newly formed name is
"LongFilename.ext", the file gets renamed to "LONGFILE.EXT".
I'm currently using the following statements to rename the file:
sprintf( buf, "ren %s %s", old_name, new_name );
system( buf );
I even tried placing quotes around the new_name, but the system() function
reports an error message.
I'm working with old tools, so that might be part of the problem, but maybe
there is a simple solution to this. I would appreciate any help. Thanks.
I'm using Borland Turbo C++ 3.0 for DOS.
use it to form a new filename for that same file. I can successfully open
the file, get the data I need and form the new name, but it truncates and
renames it in the 8.3 format. If the newly formed name is
"LongFilename.ext", the file gets renamed to "LONGFILE.EXT".
I'm currently using the following statements to rename the file:
sprintf( buf, "ren %s %s", old_name, new_name );
system( buf );
I even tried placing quotes around the new_name, but the system() function
reports an error message.
I'm working with old tools, so that might be part of the problem, but maybe
there is a simple solution to this. I would appreciate any help. Thanks.
I'm using Borland Turbo C++ 3.0 for DOS.