Thread: Extended Filenames

  1. #1
    ResurgentBarbecue UnclePunker's Avatar
    Join Date
    May 2002
    Posts
    128

    Extended Filenames

    Hello,

    I have a program that creates a text file depending on the name I give it and it renames it if the directory already Has a file of that name in it, the thing is that if the filename I give it is already 8 characters and it tries to put a 1 on the end my program goes in to an endless loop.

    could anybody help me with using extended filenames.

    Thanks.
    Compiler == Visual C++ 6.0
    "Come Out Fighting."

  2. #2
    Code Monkey Davros's Avatar
    Join Date
    Jun 2002
    Posts
    812
    Sounds like your filename functions are restricted to returning names of no more than eight characters. Borland 4.5 - that's ancient isn't it?

    What you could do is this. If the file name is 7 or less in length, add a character, as you do now. However, if the filename is 8 or more, change (increment) the 8th character instead.
    OS: Windows XP
    Compilers: MinGW (Code::Blocks), BCB 5

    BigAngryDog.com

  3. #3
    ResurgentBarbecue UnclePunker's Avatar
    Join Date
    May 2002
    Posts
    128
    Thanks,

    I have already started on that process, it's just a simple if and sizeof() thing, I was just wondering if I could use extended filenames, maybe for future reference but for now would be good too.

    If I changed my compiler would that make a difference, I thought that the 8 character limit was an operating system thing, am I wrong.

    Yes my compiler is ancient but it was free and it has served its purpose so far, If you think I should change I will.

    Any recomendations????
    Compiler == Visual C++ 6.0
    "Come Out Fighting."

  4. #4
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    The 8 letter thing is a legacy from DOS.

    Borland offer a newer compiler for free....also, there's Devc++ which uses Mingw.....

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Button handler
    By Nephiroth in forum Windows Programming
    Replies: 8
    Last Post: 03-12-2006, 06:23 AM
  2. Extended character ASCII in LINUX/WINDOWS
    By intmail in forum Linux Programming
    Replies: 2
    Last Post: 01-26-2006, 03:24 PM
  3. Getting filenames from a file
    By vinsta18 in forum C++ Programming
    Replies: 1
    Last Post: 01-12-2005, 11:52 AM
  4. reading filenames
    By Paul in forum C++ Programming
    Replies: 1
    Last Post: 07-01-2003, 10:02 AM
  5. Extended attributes
    By Unregistered in forum Windows Programming
    Replies: 0
    Last Post: 07-18-2002, 09:17 AM