Thread: file name lenght for include directive

  1. #1
    Registered User
    Join Date
    Dec 2003
    Posts
    20

    file name lenght for include directive

    hallo
    i was not able to put a file name with length say for eg. more than 8 charaters eg. #include "test12345678901093939939.h" into the include directive
    is there any restriction on this lenght?
    reg
    khaja

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    It's probably restricted by your host filing system
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    'AlHamdulillah
    Join Date
    Feb 2003
    Posts
    790
    yeah, unless its WinXP or WinNT , it still follows DOS's "8.3" rule, which basically means that the filename cannot be more than 8 characters long and the extension name cannot be more than 3 characters long.

  4. #4
    Registered User glUser3f's Avatar
    Join Date
    Aug 2003
    Posts
    345
    I think having such a long filename is a bad idea anyway, the only reason I can think of for this is prefixing your filenames, then I suggest putting files in a directory named something like the prefix.

  5. #5
    Registered User
    Join Date
    Dec 2003
    Posts
    20

    i have winnt

    yeah, unless its WinXP or WinNT , it still follows DOS's "8.3" rule, which basically means that the filename cannot be more than 8 characters long and the extension name cannot be more than 3 characters long.

    reply : i have winnt , so the error should not occur isnt it ?

  6. #6
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    What compiler are you using? DJGPP is a DOS compiler.

    I'd find it hard to believe that any modern Windows compiler suffered this limitation.

    Windows 9x also supports long file names.

    Are you sure the names match? Easy to make a mistake with a very long file name.

  7. #7
    Registered User
    Join Date
    Dec 2003
    Posts
    20
    hallo
    yes i am using a dos compiler , and ther fore the problem of 8.3 exists.
    but isnt there any way by which i could set the configuration or options to extend this length ?
    regards
    khaja

  8. #8
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > yes i am using a dos compiler , and ther fore the problem of 8.3 exists.
    Then it's restricted by the limits imposed by the OS which the compiler was originally written for.

    Which begs the question, why are you using such an old compiler when it can use so few facilities of your operating system.
    www.compilers.net has many free and more modern compilers.

    > but isnt there any way by which i could set the configuration or options to extend this length ?
    Yes, you get a compiler designed for the OS you're actually using.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  9. #9
    Registered User
    Join Date
    Dec 2003
    Posts
    20
    thank you

    > but isnt there any way by which i could set the configuration or options to extend this length ?
    Yes, you get a compiler designed for the OS you're actually using.

    but i got the compiler from the OS ( MicroC labrosse ) website
    the compiler and port of OS was given together. and the compiler i am using pacific c compiler is also listed in www.compilers.net , the only problem is , it s a DOS compiler
    and i dont know whether it is possible to compile MicroC os examples with windows compilers like borland 5.5 etc.

  10. #10
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > the compiler and port of OS was given together
    What exactly are you trying to achieve here?
    I see you asking about learning C, and about embedded operating systems and compilers. These to me are mutually exclusive activities.

    MicroC is the C compiler for the OS-II embedded real-time operating system, so neither of them are actually any use for creating programs to run on your PC.

    You say a 'port' of the OS, which suggests to me that you have an emulation of the OS-II real time operating system for use on your PC to make life easier for initial development of programs which will eventually run on a target processor in an embedded real-time environment.

    So do you actually have any real hardware to run this code on (eventually), or is it just the first book you picked up with 'C' written on it?
    Because if you're just learning C from it, you're making things way more difficult.

    > pacific c compiler
    OK, so it allows you to generate DOS programs to run inside some DOS box on your NT machine. This has little (if anything) to do with creating programs for your other OS/Compiler.

    It might be OK if you didn't have a 'port' of the embedded OS/Compiler running on your machine already, but since you do, it seems kinda redundant.
    Using any compiler on your host is always better than no compiler on your host when developing embedded applications. Any testing you can do on the host is always preferable to debugging on the target.

    > possible to compile MicroC os examples with windows compilers like borland 5.5 etc
    The compiler will, the usual problem is in the linker stage when you need to resolve all those OS-Specific API calls. Again, this is what the 'port' is designed to achieve - namely an environment which looks like your target from an API standpoint, but which actually runs on the host for greater convenience.

    You're just Learning C, and you're way out of your depth here. You don't need all these cross-compiler and embedded OS issues confusing matters.

    Get a nice easy to use host only compiler such as DEV-C++, where you have a nice IDE to play with, and it produces code to run on your PC.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  11. #11
    Registered User
    Join Date
    Dec 2003
    Posts
    20
    > the compiler and port of OS was given together
    What exactly are you trying to achieve here?
    I see you asking about learning C, and about embedded operating systems and compilers. These to me are mutually exclusive activities.

    Sorry if ihad confused you too much.

    I will explain , what i am doing.

    1. First i am trying to execute the example programs given in the book microC by labrosse. Since i must make programs which run on a target processor.

    2. Since i donot have borland 4.5 ( dos compiler ) which is mentioned in the book to be used in order to run the programs, i used the port as suggested . I used the port of microC with pacific c compiler. I was able to compile and run the programs but only problem was this #include direction filename size.

    So in short to explain i am learning C and at the same time i am into embedded programming.

    Sorry for asking questions but i have to :

    1. What is the difference between a dos compiler and a windows compiler ?

    2.as you said :
    > possible to compile MicroC os examples with windows compilers like borland 5.5 etc
    The compiler will, the usual problem is in the linker stage when you need to resolve all those OS-Specific API calls. Again, this is what the 'port' is designed to achieve - namely an environment which looks like your target from an API standpoint, but which actually runs on the host for greater convenience.

    yes i had problems in linker stage ,exactly , if we resolve the OS specific API calls , is it possible to run this program on windows. Since the micro C was developed with borland 4.5 ver (which is a dos compiler ) , and borland 5.5 is windows compiler, my question is it possible to run the exe . I was not able to run , there was a run time error when i did this.

    any way thanks for the help so far

    regards
    khaja

  12. #12
    Registered User
    Join Date
    Oct 2010
    Posts
    1
    hallo
    i was not able to put a file name with length say for eg. more than 8 charaters eg. #include "test12345678901093939939.h" into the include directive
    is there any restriction on this lenght?
    reg
    khaja



    Hi,
    I am using Turbo C Compiler and i am working on to create a file using Time Stamp Values as my file name which is 14 charecters. But i face the same issue as you did. i.e only 8 char supported for file names.

    Kindly tell m eis your problem sorted.
    If so How did you solved.
    Kindly give suggestions.

    Regards,
    A.Thamizh Mugilan

  13. #13
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Maybe you should try reading ALL of the replies of this 7 YEAR old thread you decided to bump.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. opening empty file causes access violation
    By trevordunstan in forum C Programming
    Replies: 10
    Last Post: 10-21-2008, 11:19 PM
  2. Need Help Fixing My C Program. Deals with File I/O
    By Matus in forum C Programming
    Replies: 7
    Last Post: 04-29-2008, 07:51 PM
  3. System
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 10:12 PM
  4. Hmm....help me take a look at this: File Encryptor
    By heljy in forum C Programming
    Replies: 3
    Last Post: 03-23-2002, 10:57 AM
  5. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 02:58 AM