Last active
April 20, 2024 20:46
-
-
Save mcsee/647393a744f23bb2594cd309ba92e56c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$sourceFile = 'C:\temp\source.txt'; | |
$destination = 'C:\temp\destination.txt'; | |
$copyWasSuccessful = copy($sourceFile, $destination); // true | |
$destinationFileExists = file_exists($destination); // true | |
$sourceFile = 'C:\temp\source.txt'; | |
$destination = 'C:\temp\destination :txt'; | |
// The filename is simplified | |
// and might come from a programmatic construction | |
$copyWasSuccessful = copy($sourceFile, $destination); | |
// true - this is a mistake | |
$destinationFileExists = file_exists($destination); | |
// false since it was not created | |
$destinationChangedFileExists = file_exists('C:\temp\destination '); | |
// true but unexpected |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment