Thread: Making folder name lowercase

  1. #1
    Registered User
    Join Date
    Jun 2006
    Posts
    27

    Making folder name lowercase

    Hi. When I call mkdir to make a directory, the directory that gets created has a name all in uppercase, even though the string I specified in mkdir is lowercase. Can anyone please tell me how I can make the created folder's name be lowercase?

    Also, is there a way to make a directory structure directly, with out calling mkdir one level at a time? For example, if I wanted to make C:\a\b\c\d, but only folder 'a' currently exists. I notice that mkdir doesn't work if I do mkdir ("C:\\a\\b\\c\\d") directly (if a, b, c already exists, it works). Is there a better way to create the directory structure than manually creating one level at a time?

    Thank you.

  2. #2
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,218
    Which compiler are you using? My compiler doesn't exhibit the same behavior (making the folder name uppercase when passed a lowercase string). If you say you're using some win16 compiler then my answer will be to move into the 21st century already and upgrade to a real compiler.

    Also, is there a way to make a directory structure directly, with out calling mkdir one level at a time?
    No. You can can create a function to do it for you pretty easily though.
    If you understand what you're doing, you're not learning anything.

  3. #3
    Registered User
    Join Date
    Jun 2006
    Posts
    27
    If you say you're using some win16 compiler then my answer will be to move into the 21st century already and upgrade to a real compiler.
    Yes, I'm afraid I am using a 16bit compiler. It's Borland C++ 4.5, I think, but set to compile in 16-bit mode. Does that mean that I can't do anything about the folder name being uppercase? Thanks.

    And yes, making a function to create the directory structure was simple enough, like you said.

    PS: Before you make fun of me, I assure you there's a good reason it's 16-bit. And it's not my choice.

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    > Does that mean that I can't do anything about the folder name being uppercase?
    Probably not, since the translation is probably happening in the compatibility layer between your 16-bit world and the real OS underneath, whose file system probably isn't even FAT anymore (but NTFS)
    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.

  5. #5
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. making sprites
    By DavidP in forum Game Programming
    Replies: 9
    Last Post: 02-20-2010, 07:00 AM
  2. Making screensavers work outside the windows folder
    By Da-Nuka in forum Windows Programming
    Replies: 3
    Last Post: 04-20-2005, 02:27 PM
  3. Creating a Folder
    By Junior89 in forum C++ Programming
    Replies: 9
    Last Post: 11-07-2004, 12:45 AM
  4. Making control...
    By Finchie_88 in forum C++ Programming
    Replies: 2
    Last Post: 09-07-2004, 01:42 PM
  5. making lowercase??/
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 03-05-2002, 08:54 AM