path problem in cygwin

This is a discussion on path problem in cygwin within the Tech Board forums, part of the Community Boards category; I'm running cygwin on Win2k. In cygwin, I built a C program called prog, which takes a number and a ...

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    18

    path problem in cygwin

    I'm running cygwin on Win2k. In cygwin, I built a C program called prog, which takes a number and a file as cmdline parameters. prog is in /usr/coding. If I save the input file in that directory, then it runs fine.
    But when I try to run it by typing:
    prog 2 /usr/coding/test/filename, it fails. I get that one of the functions in prog cannot open the file. Strangely, though, when I type something like "ls /usr/coding/test" it's there. Even stranger, I can run it by typing the Windows path of the filename. Might someone have an idea of whats going on? Thanks

  2. #2
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    try using a relative path.

    ./prog 2 test/filename
    or maybe
    ./prog 2 ./test/filename
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. clipping path
    By stanlvw in forum Windows Programming
    Replies: 0
    Last Post: 07-23-2008, 11:47 PM
  2. Shortest path problem
    By Digitalxero in forum C++ Programming
    Replies: 0
    Last Post: 10-25-2005, 05:32 PM
  3. searching problem
    By DaMenge in forum C Programming
    Replies: 9
    Last Post: 09-12-2005, 01:04 AM
  4. Bin packing problem....
    By 81N4RY_DR460N in forum C++ Programming
    Replies: 0
    Last Post: 08-01-2005, 05:20 AM
  5. Strange problem with fts_open call
    By jhopper in forum C Programming
    Replies: 0
    Last Post: 02-25-2002, 11:01 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21