Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

is_executable(3) [php man page]

IS_EXECUTABLE(3)							 1							  IS_EXECUTABLE(3)

is_executable - Tells whether the filename is executable

SYNOPSIS
bool is_executable (string $filename) DESCRIPTION
Tells whether the filename is executable. PARAMETERS
o $filename - Path to the file. RETURN VALUES
Returns TRUE if the filename exists and is executable, or FALSE on error. EXAMPLES
Example #1 is_executable(3) example <?php $file = '/home/vincent/somefile.sh'; if (is_executable($file)) { echo $file.' is executable'; } else { echo $file.' is not executable'; } ?> ERRORS
/EXCEPTIONS Upon failure, an E_WARNING is emitted. NOTES
Note The results of this function are cached. See clearstatcache(3) for more details. Tip As of PHP 5.0.0, this function can also be used with some URL wrappers. Refer to "Supported Protocols and Wrappers" to determine which wrappers support stat(3) family of functionality. SEE ALSO
is_file(3), is_link(3). PHP Documentation Group IS_EXECUTABLE(3)

Check Out this Related Man Page

IS_LINK(3)								 1								IS_LINK(3)

is_link - Tells whether the filename is a symbolic link

SYNOPSIS
bool is_link (string $filename) DESCRIPTION
Tells whether the given file is a symbolic link. PARAMETERS
o $filename - Path to the file. RETURN VALUES
Returns TRUE if the filename exists and is a symbolic link, FALSE otherwise. EXAMPLES
Example #1 Create and confirm if a file is a symbolic link <?php $link = 'uploads'; if (is_link($link)) { echo(readlink($link)); } else { symlink('uploads.php', $link); } ?> ERRORS
/EXCEPTIONS Upon failure, an E_WARNING is emitted. NOTES
Note The results of this function are cached. See clearstatcache(3) for more details. Tip As of PHP 5.0.0, this function can also be used with some URL wrappers. Refer to "Supported Protocols and Wrappers" to determine which wrappers support stat(3) family of functionality. SEE ALSO
is_dir(3), is_file(3), readlink(3). PHP Documentation Group IS_LINK(3)
Man Page

15 More Discussions You Might Find Interesting

1. Cybersecurity

TCP Wrappers

I have installed TCP wrappers , Good package ... I have a problem with the hosts_options part ... I am not able to use the twist command .. It just dosent respond I have compiled wrappers 7.6 for Solaris 8 with ipv6 support ... Everything works fine except the twist doesnt work I have... (1 Reply)
Discussion started by: DPAI
1 Replies

2. Programming

How to get exit value of an executable that gets called from function?

How to get exit value of an executable that gets called from function? I have an executable called “myexec” which returns 0 on success and different values for different fail scenarios. I need to call this (myexec) executable from “myprog()” function of other executable and get the exit value... (1 Reply)
Discussion started by: sureshreddi_ps
1 Replies

3. Programming

Renaming an executable file

HI How to rename an executable file in unix (3 Replies)
Discussion started by: bankpro
3 Replies

4. Shell Programming and Scripting

Executable file

Hi everybody: I have strange problem. I have compiled a source code and created an executable file. This file I can use it into my PC, but when I copy this executable to my laptop this one doesn't work and the system tell me: bash: ./sbdart_unix: cannot execute binary file Somebody can... (3 Replies)
Discussion started by: tonet
3 Replies

5. Solaris

How to force executable creation

Hello all Im using sun9 compiler and I like to create executable even if I have undefined symbols Some one knows what is the flag to do so ? (2 Replies)
Discussion started by: umen
2 Replies

6. Shell Programming and Scripting

When running if condition, getting the following error

Hi All, My input file name is 1.sh the contents of file are cat status2.txt | while read filename do echo "$filename" echo "first content of the file is ${filename}" echo "second content of the file is ${filename}" echo "second content of the file is ${filename}" if } -eq 0 -a... (1 Reply)
Discussion started by: sunitachoudhury
1 Replies

7. Shell Programming and Scripting

Check for file size is zero or not.

I have following script on AIX/KSH if ] ; then echo "filename exists and is > 0 bytes" else echo "filename does not exist or is zero length" fi It is not working. What is wrong here??? (3 Replies)
Discussion started by: Hangman2
3 Replies

8. Shell Programming and Scripting

Linux Script to move executable to quarantine

Please help! I am preparing a Linux Script to move windows executable files from samba directory to quarantine directory. For safety, will use "file" command to determine if its executable. Anyone can help? Below is my trial script, but it just move everything, including non-executable.. any wrong... (2 Replies)
Discussion started by: gavintam
2 Replies

9. Linux

"not stripped" executable file

Hi, What exactly is meant by a "not stripped" executable file? (4 Replies)
Discussion started by: bruceblacklaws
4 Replies

10. UNIX for Dummies Questions & Answers

assingn a variable a filename and then reading it in

Im trying to set a filename to a variable and then read the file in using the variable but im getting a syntax error. any ideas? #!/bin/bash function scanFile() { while read $1 do echo $filename done } file1=report.log scanFile() $file1 (3 Replies)
Discussion started by: magnia
3 Replies

11. Programming

Call a C programming executable inside a C program

hi guys i have only basic knowledge of C so guys plz help me ..... is C language support call the C executable inside the C ?? example contect mainA.c have a many function define in the struct,when i compile mainA and make a executable the name is ( A ),can i use executable C inside the C... (5 Replies)
Discussion started by: isnoname
5 Replies

12. UNIX for Dummies Questions & Answers

What are the executable file formats in Solaris and Linux?

we all knew that .exe files are the executable file formats in windows....... Similarly, what are the executable file formats in solaris and linux ........ please tell me:D Thanks in Advance. (2 Replies)
Discussion started by: vamshigvk475
2 Replies

13. UNIX for Dummies Questions & Answers

Command - filename as arguments - make executable to all users.

Edit: Sorry. Mistakenly posted - please delete (3 Replies)
Discussion started by: Reddax
3 Replies

14. Shell Programming and Scripting

Bash script make itself executable

Is there a way to make this make itself executable? Thanks. :-) cat > somescript.sh << \EOF #!/bin/bash block_count=$(sudo tune2fs -l /dev/sda1 | awk '/^Block count:/ {print $NF}') reserved_block_count=$(sudo tune2fs -l /dev/sda1 | awk '/^Reserved block count:/ {print $NF}') perl -e... (4 Replies)
Discussion started by: drew77
4 Replies

15. UNIX for Beginners Questions & Answers

Motif GUI example. UNIX executable ready.

Motif GUI example. Unix executable ready. Hi , i have attached my executable GUI example file in form of a .gz file. please gunzip file before. May i ask you for check it out that it is running on your machine ? You should have "Motif" package installed. when you klick the unix executable... (4 Replies)
Discussion started by: Sennenmut
4 Replies