Skip to content

Implemented touch() function.#781

Open
comm644 wants to merge 2 commits intoVKCOM:masterfrom
comm644:comm644/runtime_touch
Open

Implemented touch() function.#781
comm644 wants to merge 2 commits intoVKCOM:masterfrom
comm644:comm644/runtime_touch

Conversation

@comm644
Copy link

@comm644 comm644 commented Mar 11, 2023

Please integrate function touch().

I don't understood how to add unit-tests , but i wrote it. Please add.

unit-test:

<?php
$filename = tempnam("/tmp", "ktouch");
$time1 = filemtime($filename);
sleep( 3 );
$rc = touch($filename, time()-30, time()-50);
if  (!$rc) {
        throw new \RuntimeException("touch() failed: $filename. rc=$rc");
}

$time2 = filemtime($filename);

if ( $time1 === $time2 ) throw new \RuntimeException("touch() does not work: $time1 !== $time2");
echo "ok\n";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant