Re: link vs file

From: Date: Mon, 17 Dec 2018 21:52:27 +0000
Subject: Re: link vs file
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-326650@lists.php.net to get a copy of this message
link — Create a hard link is_link — Tells whether the filename is a symbolic link Look up the difference between hard and soft/symbolic links. -Shawn On Mon, Dec 17, 2018 at 3:27 PM Jeffry Killen <jekillen@prodigy.net> wrote: > Hello: > > I am trying to get a feel for the difference > between is_link and is_file. > > So I ran this code: the result is in comment block at the bottom > > <?php > if(link('index.php', 'indexLink') === false) > { > print "link failed"; > } > else > { > $_linkRes = 'false'; > $_fileRes = 'false'; > if(is_link('indexLink')) > { > $_linkRes = 'true'; > } > else if(is_file('indexLink')) > { > $_fileRes = 'true'; > } > print 'indexLink: link; '.$_linkRes."<br>"; > print 'indexLink: file; '.$_fileRes; > } > /* > output: > indexLink: link; false > indexLink: file; true > */ > ?> > > Why is it returning false for link and true for file? > > This is an apache/php v 5.3x installation on Mac Yosemite. > > Forgive my ignorance, but I have not worked with links up > to this point. If I load http://localhost/indexLink I get a ton > of raw code and some html rendered. > > Thank you for time and attention > JK >

« previous php.general (#326650) next »