fopen() in C will not accept pathnames preceding with ~

Why is it that on my Linux system, fopen() will not recognize filepaths preceding with ~

e.g.
~/programs/myprogram

vs.

/home/USER123/programs/myprogram


Thanks

Comments

  • : Why is it that on my Linux system, fopen() will not recognize filepaths preceding with ~
    :
    : e.g.
    : ~/programs/myprogram
    :
    : vs.
    :
    : /home/USER123/programs/myprogram
    :
    :
    : Thanks

    are you sure you are logged in as the correct user ?

  • : Why is it that on my Linux system, fopen() will not recognize filepaths preceding with ~
    :
    : e.g.
    : ~/programs/myprogram
    :
    : vs.
    :
    : /home/USER123/programs/myprogram
    :
    :
    : Thanks

    It's a feature. ~ is interpreted by the shell, not by the C library.
  • : : Why is it that on my Linux system, fopen() will not recognize filepaths preceding with ~
    : :
    : : e.g.
    : : ~/programs/myprogram
    : :
    : : vs.
    : :
    : : /home/USER123/programs/myprogram
    : :
    : :
    : : Thanks
    :
    : It's a feature. ~ is interpreted by the shell, not by the C library.
    :
    Oh, I didn't knew that :) thanks
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories