Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

filetype(3) [php man page]

FILETYPE(3)								 1							       FILETYPE(3)

filetype - Gets file type

SYNOPSIS
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

FILESIZE(3)								 1							       FILESIZE(3)

filesize - Gets file size

SYNOPSIS
int filesize (string $filename) DESCRIPTION
Gets the size for the given file. PARAMETERS
o $filename - Path to the file. RETURN VALUES
Returns the size of the file in bytes, or FALSE (and generates an error of level E_WARNING) in case of an error. Note Because PHP's integer type is signed and many platforms use 32bit integers, some filesystem functions may return unexpected results for files which are larger than 2GB. EXAMPLES
Example #1 filesize(3) example <?php // outputs e.g. somefile.txt: 1024 bytes $filename = 'somefile.txt'; echo $filename . ': ' . filesize($filename) . ' bytes'; ?> 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
file_exists(3). PHP Documentation Group FILESIZE(3)
Man Page

7 More Discussions You Might Find Interesting

1. Programming

stat() fails!!! what can i do?

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)
Discussion started by: solvman
3 Replies

2. Shell Programming and Scripting

grep Question

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)
Discussion started by: yerra
10 Replies

3. UNIX for Dummies Questions & Answers

Accessing .a archives in win32 environment

I am not very familiar with the .a Unix library filetype. Is it possible to extract the contents of a .a in a win32 environment? Thank you. (1 Reply)
Discussion started by: nf175c
1 Replies

4. Shell Programming and Scripting

editing a file

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)
Discussion started by: Aditya.Gurgaon
2 Replies

5. Shell Programming and Scripting

Not able to assign a value to variable

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)
Discussion started by: Amey Joshi
13 Replies

6. UNIX for Dummies Questions & Answers

How to move files based on filetype and time created?

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)
Discussion started by: LuckyTommy
6 Replies

7. UNIX for Dummies Questions & Answers

Help with stat command

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)
Discussion started by: parpaa
9 Replies