FILETYPE(3) 1 FILETYPE(3)filetype - Gets file typeSYNOPSIS
string filetype (string $filename)
DESCRIPTION
Returns the type of the given file.
PARAMETERS
o $filename
- Path to the file.
RETURN VALUES
Returns the type of the file. Possible values are fifo, char, dir, block, link, file, socket and unknown.
Returns FALSE if an error occurs. filetype(3) will also produce an E_NOTICE message if the stat call fails or if the file type is unknown.
EXAMPLES
Example #1
filetype(3) example
<?php
echo filetype('/etc/passwd'); // file
echo filetype('/etc/'); // dir
?>
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), is_link(3), file_exists(3), mime_content_type(3), pathinfo(3), stat(3).
PHP Documentation Group FILETYPE(3)
Check Out this Related Man Page
IS_EXECUTABLE(3) 1 IS_EXECUTABLE(3)is_executable - Tells whether the filename is executableSYNOPSIS
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)
Hi all,
I can not understand why my stat() function fails all the time when function tries to go recursevly. Someone suggested that it might be poiter problem. Please, look up my code at: www.donnelly.cc.ks.us/readdir_test.c. How can i solve this problem? Any suggestion are welcome!
Thank you... (3 Replies)
I have a file which loads procedure/function into ORACLE.Top of the file contains 3 rows which is FILENAME, FILETYPE AND COMMENTS and then the function/procedure etc.
FILENAME:
FILETYPE:
COMMENTS:
<Function/Procedure etc>
The Filename,FILETYPE, COMMENTS will be entered by the dba which... (10 Replies)
Hi
i have a file name as file1 which has Following content:
ROLLOVER_INTERVAL=0
OUTPUT_DIR_COUNT=MULTIPLE
FILETYPE=XmlExporter
i want to change the FILETYPE=recordexport
can any one pls help me on this
2nd query:
i want to change OUTPUT_DIR_COUNT=MULTIPLE as
... (2 Replies)
Hi Experts,
I am facing some problem while developing the script.My input config.csv file contains the three columns namely pathname,filename,filetype.Based on the file type i have to use ftp command that is if filetype=csv then do ftp.
The input file is
cat config.csv... (13 Replies)
Hi,
I'm trying to improve my Unix skills and I'm wondering what is the best way to move some files based on filetype and attributes like time created?
For instance, lets suppose I have a directory with many different files in it and I'd like to move all the jpgs that were created between May... (6 Replies)
Hi Experts,
I am here with very simple request:
#!bin/bash
a=`stat -c %y log1.csv`
echo $a
and this stat command returning value as
2013-08-11 05:42:10.000000000 -0400:
But I want to see in mm/dd/yyyy format?
any help is highly appreciated thank you
---------- Post... (9 Replies)