Portable way of obtaining current working directory......

Discussion in 'C++' started by Shaun Heveron, Oct 27, 2004.

  1. Hi,

    I'm working on a portable ANSI C++ application designed to compile and
    execute under Windows and LINUX/UNIX.

    Is there a portable way of obtaining the current working directory? Sorry,
    if I'm being stupid...

    Thanks,

    Shaun
     
    Shaun Heveron, Oct 27, 2004
    #1
    1. Advertising

  2. Shaun Heveron wrote:
    > I'm working on a portable ANSI C++ application designed to compile and
    > execute under Windows and LINUX/UNIX.
    >
    > Is there a portable way of obtaining the current working directory? Sorry,
    > if I'm being stupid...


    You're not being stupid, you're just being in the wrong newsgroup.
    I'd recommend asking in both Windows (comp.os.ms-windows.programmer)
    and Linux (comp.os.linux.development.apps) newsgroups. If you care
    about UNIX, you'd have to extend your search to the appropriate UNIX
    newsgroup too.

    The trouble is, C++ doesn't have any way of obtaining "current" or
    "working" directory because it doesn't have the concept of 'a directory'.

    V
     
    Victor Bazarov, Oct 27, 2004
    #2
    1. Advertising

  3. Victor Bazarov, Oct 27, 2004
    #3
  4. Shaun Heveron

    Jeff Flinn Guest

    "Shaun Heveron" <> wrote in message
    news:417fa8d7$0$27544$...
    > Hi,
    >
    > I'm working on a portable ANSI C++ application designed to compile and
    > execute under Windows and LINUX/UNIX.
    >
    > Is there a portable way of obtaining the current working directory? Sorry,
    > if I'm being stupid...


    See http://www.boost.org/libs/filesystem/doc/index.htm which supports
    windows and POSIX file systems in a semi-portable fashion.

    Jeff F
     
    Jeff Flinn, Oct 27, 2004
    #4
  5. Shaun Heveron

    Lieven Guest

    Victor Bazarov wrote:

    > Shaun Heveron wrote:
    >> I'm working on a portable ANSI C++ application designed to compile and
    >> execute under Windows and LINUX/UNIX.
    >>
    >> Is there a portable way of obtaining the current working directory?
    >> Sorry, if I'm being stupid...

    >
    > You're not being stupid, you're just being in the wrong newsgroup.
    > I'd recommend asking in both Windows (comp.os.ms-windows.programmer)
    > and Linux (comp.os.linux.development.apps) newsgroups. If you care
    > about UNIX, you'd have to extend your search to the appropriate UNIX
    > newsgroup too.
    >
    > The trouble is, C++ doesn't have any way of obtaining "current" or
    > "working" directory because it doesn't have the concept of 'a directory'.
    >
    > V


    Take a look here:

    http://tinf2.vub.ac.be/~dvermeir/software/dv/index.html
     
    Lieven, Oct 28, 2004
    #5
  6. Shaun Heveron

    Lieven Guest

    Lieven wrote:

    > Victor Bazarov wrote:
    >
    >> Shaun Heveron wrote:
    >>> I'm working on a portable ANSI C++ application designed to compile and
    >>> execute under Windows and LINUX/UNIX.
    >>>
    >>> Is there a portable way of obtaining the current working directory?
    >>> Sorry, if I'm being stupid...

    >>
    >> You're not being stupid, you're just being in the wrong newsgroup.
    >> I'd recommend asking in both Windows (comp.os.ms-windows.programmer)
    >> and Linux (comp.os.linux.development.apps) newsgroups. If you care
    >> about UNIX, you'd have to extend your search to the appropriate UNIX
    >> newsgroup too.
    >>
    >> The trouble is, C++ doesn't have any way of obtaining "current" or
    >> "working" directory because it doesn't have the concept of 'a directory'.
    >>
    >> V

    >
    > Take a look here:
    >
    > http://tinf2.vub.ac.be/~dvermeir/software/dv/index.html


    And especially this will interest you:

    http://tinf2.vub.ac.be/~dvermeir/software/dv/dvutil/html/classDv_1_1Util_1_1Directory.html
     
    Lieven, Oct 28, 2004
    #6
  7. Shaun Heveron

    Lieven Guest

    Lieven, Oct 28, 2004
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eli Bendersky
    Replies:
    1
    Views:
    1,171
    Mike Treseler
    Mar 1, 2006
  2. Jason \(MFT1\)
    Replies:
    1
    Views:
    384
    Jason \(MFT1\)
    Aug 15, 2003
  3. Replies:
    7
    Views:
    921
  4. Bob Walton
    Replies:
    9
    Views:
    190
    David K. Wall
    Sep 26, 2003
  5. Michael Preminger

    obtaining name of the current subroutine

    Michael Preminger, Jul 16, 2004, in forum: Perl Misc
    Replies:
    1
    Views:
    95
    Vetle Roeim
    Jul 16, 2004
Loading...

Share This Page