TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Neil Heller
from: Darin McBride
date: 2003-05-26 15:12:12
subject: Linux and GCC

Hello Neil!

Replying to a message of Neil Heller to Darin McBride:

 DM>> Thus, "foo" is just a file, but if it has the execute
bit set,...

 DM>> Certain conventions exist for executable source code (such as shell
 DM>> scripts  or perl scripts),...

 NH> Which bring another question to mind.  If I write a program that
 NH> prompts  the user for a file name, and then pass that name directly
 NH> to fopen()  must that file name have "./" prepended if the target
 NH> file is in the  same directory as the executable and that directory
 NH> is not in the path?

No.  Think of it this way.  On DOS/Windows/OS2, PATH always has an implicit
"." path at the front.  The shell always looks there first.  On
Unix, however, recognising that this can be insecure, asks that you make .
explicit if you want it.  The fopen function doesn't use PATH, it uses
different rules.  If you do not specify an absolute path (starting with
"/" on unix), then it's relative to the current working
directory.

Darin

---
* Origin: Tanktalus' Tower BBS (1:250/102)
SEEN-BY: 633/267 270
@PATH: 250/102 99 10/345 106/1 2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.