DIRECTORYITERATOR.GETCTIME(3) 1 DIRECTORYITERATOR.GETCTIME(3)DirectoryIterator::getCTime - Get inode change time of the current DirectoryIterator item
SYNOPSIS
public int DirectoryIterator::getCTime (void )
DESCRIPTION
Get the inode change time for the current DirectoryIterator item.
PARAMETERS
This function has no parameters.
RETURN VALUES
Returns the last change time of the file, as a Unix timestamp.
EXAMPLES
Example #1
DirectoryIterator.getCTime(3) example
This example displays the file name and last change time of the files in the directory containing the script.
<?php
$iterator = new DirectoryIterator(dirname(__FILE__));
foreach ($iterator as $fileinfo) {
if ($fileinfo->isFile()) {
echo $fileinfo->getFilename() . " changed at " . $fileinfo->getCTime() . "
";
}
}
?>
The above example will output something similar to:
apple.jpg changed at 1240398312
banana.jpg changed at 1238605440
index.php changed at 1240398935
pear.jpg changed at 1237423740
SEE ALSO
DirectoryIterator::getATime, DirectoryIterator::getMTime, filectime(3).
PHP Documentation Group DIRECTORYITERATOR.GETCTIME(3)
Check Out this Related Man Page
DIRECTORYITERATOR(3) 1 DIRECTORYITERATOR(3)The DirectoryIterator classINTRODUCTION
The DirectoryIterator class provides a simple interface for viewing the contents of filesystem directories.
CLASS SYNOPSIS
DirectoryIterator
DirectoryIteratorextends
SplFileInfoSeekableIterator
Methods
o public DirectoryIterator::__construct (string $path)
o public DirectoryIterator DirectoryIterator::current (void )
o public int DirectoryIterator::getATime (void )
o public string DirectoryIterator::getBasename ([string $suffix])
o public int DirectoryIterator::getCTime (void )
o public string DirectoryIterator::getExtension (void )
o public string DirectoryIterator::getFilename (void )
o public int DirectoryIterator::getGroup (void )
o public int DirectoryIterator::getInode (void )
o public int DirectoryIterator::getMTime (void )
o public int DirectoryIterator::getOwner (void )
o public string DirectoryIterator::getPath (void )
o public string DirectoryIterator::getPathname (void )
o public int DirectoryIterator::getPerms (void )
o public int DirectoryIterator::getSize (void )
o public string DirectoryIterator::getType (void )
o public bool DirectoryIterator::isDir (void )
o public bool DirectoryIterator::isDot (void )
o public bool DirectoryIterator::isExecutable (void )
o public bool DirectoryIterator::isFile (void )
o public bool DirectoryIterator::isLink (void )
o public bool DirectoryIterator::isReadable (void )
o public bool DirectoryIterator::isWritable (void )
o public string DirectoryIterator::key (void )
o public void DirectoryIterator::next (void )
o public void DirectoryIterator::rewind (void )
o public void DirectoryIterator::seek (int $position)
o public string DirectoryIterator::__toString (void )
o public bool DirectoryIterator::valid (void )
CHANGELOG
+--------+----------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+----------------------------------------+
| 5.1.2 | |
| | |
| | DirectoryIterator extends SplFileInfo. |
| | |
+--------+----------------------------------------+
PHP Documentation Group DIRECTORYITERATOR(3)
Hi there. This is probably a very stupid question, but...
How do I change or set the time in UNIX? I am taking care of a Sun Ultra 5 running SunOS 5.7 and I can't figure out how to change the time.
Help. (3 Replies)
Whats the command in unix to do this ;
rename a bunch (3000) of files called ;
0001.jpg
0002.jpg
0003.jpg
0004.jpg
to
0001_LRG.jpg
0002_LRG.jpg
0003_LRG.jpg
etc.
i.e. adding the extension _LRG to the end of the filename ? (3 Replies)
I have just upgrade my version of pear to the latest version but when issue pear list
I get the following error messages
<br />
<b>Fatal error</b>: Call to undefined function: getoptions() in <b>/usr/bin/pear</b> on line <b>34</b><br />
what am i doing wrong? can you help please.
... (0 Replies)
Hi i am am monitioring a file every 60 seconds and checking if the file has changed and if it has changed i append the changes to another file. i am able to monitior the change in file size but i have a problem copying the changes made in the file to another file. i am using lseek to seek the last... (1 Reply)
folowing code is not working I am a newbie can u help me about it I need to match an array variable to a pattern which is like -rw-r--r--
if } =.r........ ] /* I tried to make every like to accept every thing that starts with any char that has secon char as r and accept any 8 chars after *\... (1 Reply)
Discussion started by: feline
1 Replies
7. Post Here to Contact Site Administrators and Moderators
I am having a problem getting this to work right. The script needs to search through directories and subdirectories. If a jpg is found then create a folder in that directory, so on and so forth. Here is what I have so far but it doesn't work right. Help please
#!/bin/bash
for d in `find ./... (1 Reply)
Hi All, I'm struggling with a problem.
Data file example:
Brown|32 inches|apple|monkey
Green|12 feet|grape|cat
Blue|32 inches|banana|dog
Black|23 inches|pear|horse
I need to change the value '32 inches' in the third line, and only the third line, while keeping the rest of the file the... (7 Replies)
Hi guys im currently trying to write a script which includes rename files and this is the part where i fail
i have a list of files eg
and i want to rename them so
any help really would be appreciated
Cheers dunryc (7 Replies)
i have a requirement where i needed to change variable values in a properties file(first file) whenever there is change to Release details file(second file). My question is do i have to create a daemon process that always checks the modified time/inode change of the second file and then change the... (1 Reply)
Hi, I just wondering I done program which will list .jpg extension file but if there is not .jpg file in current directory display error how to do it ; here is my code
#!/bin/sh
echo "Enter a program function :" # declear User input
read func1 func2
## user must input list follow by... (1 Reply)
Hey guys,
I am looking for simple shell script, so i can remove every second file in a directory.
For example in any given directory there are 10.000 files:
0001.jpg
0002.jpg
0003.jpg
0004.jpg
0005.jpg
0006.jpg
0007.jpg
0008.jpg
....
1111.jpg
1112.jpg
etc.
After running the... (5 Replies)
I want to change the name of several files within a folders (directory) and subdirectories in OS X. If I only wanted to change file names within the directory I guess I would use:
rm photo*.jpg picture*.jpg
I have lots of subdirectories, is there a way of getting the file changes for all... (5 Replies)
I had a router change and needed to change the ip in some machines.
I have two machines on SCO Unix 3.2.4.2
I changed the IP in my chain(relinked kernel, used as default) and in /etc/hosts on both.
One is fine. The other I am unable to get to with putty.
Is there anything else I would need to... (11 Replies)