older 'C' application - update to work with long f

  • 13 years ago

    heya


    I have to convert an old dos program to use long file names. The code is standard C code that does parsing/editing of other files. It is really --- very small code --- and I need to update it so I can use as a win2000 console application. Anyone can point me to what do I need to change so I can have this working? I assume that this is nothing spectacular for someone who regulary work in C/C++, and it is realtively easy, but for me - well I really need some hints and queuepoints to start from? Or eventually some similar application that I can reference to for further research how to solve it.


    I suppose that providing code snippets can further help to some of you so you can respond better - If so I'll provide, just let me know what would you need!



    Thanks!


    /kocho

  • 13 years ago

    If the legacy code is using the stdio.h functions to open the filehandle, I don't think you'll need to change anything to support long file names when you move over to Win2K. However, it's a different story if the application makes an assumption that the filename will be in 8.3 format. If that is the case, you'll need to replace all that code to be less restrictive on file name format.


    Can you post a snippet of code to the forum that shows where in the code you are having issues with the long filenames?


    Whilst this may be an obvious question, have you tried running the app on Win2K and found it troublesome? If you haven't tried running it on Win2K then give that a go.


    Can you be more specific as to why and how it is failing with the long file names? Do you see errors?


    It may also be down to internal buffers within the code being defined to be too short (say 256 character max). Try extending filename buffers to be 1024 character or an appropriate value you are comfortable with.

  • 13 years ago

    Quote:
    [1]Posted by chrisdickson on 23 Jan 2006 01:43 AM[/1]
    If the legacy code is using the stdio.h functions to open the filehandle, I don't think you'll need to change anything to support long file names when you move over to Win2K. However, it's a different story if the application makes an assumption that the filename will be in 8.3 format. If that is the case, you'll need to replace all that code to be less restrictive on file name format.


    I solved it - the first part it is - I just did recompile the code using dev c++, and everything is okay.


    Thanks for you effort and really thanks for taking the time to help me!!


    Thanks again!



    regards,
    kocho

  • 13 years ago

    No problem. Glad it worked out well for you.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Anyone who considers arithmetic methods of producing random digits is, of course, in a state of sin.” - John von Neumann