Changeset 258
- Timestamp:
- 10/21/07 00:46:45 (9 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/2.3/classes/phing/system/io/FileSystem.php
r227 r258 128 128 */ 129 129 abstract function fromURIPath($path); 130 130 131 131 /* -- Path operations -- */ 132 132 … … 191 191 } 192 192 } 193 193 194 /** 195 * Whether file can be deleted. 196 * @param PhingFile $f 197 * @return boolean 198 */ 199 function canDelete(PhingFile $f) 200 { 201 clearstatcache(); 202 $dir = dirname($f->getAbsolutePath()); 203 return (bool) @is_writable($dir); 204 } 205 194 206 /** 195 207 * Return the time at which the file or directory denoted by the given branches/2.3/classes/phing/system/io/PhingFile.php
r185 r258 531 531 function delete() { 532 532 $fs = FileSystem::getFileSystem(); 533 if ($fs->c heckAccess($this, true) !== true) {534 throw new IOException(" No read access to " . $this->path."\n");533 if ($fs->canDelete($this) !== true) { 534 throw new IOException("Cannot delete " . $this->path . "\n"); 535 535 } 536 536 return $fs->delete($this); branches/2.3/classes/phing/system/io/UnixFileSystem.php
r123 r258 264 264 } 265 265 266 /** 267 * Whether file can be deleted. 268 * @param PhingFile $f 269 * @return boolean 270 */ 271 function canDelete(PhingFile $f) 272 { 273 @clearstatcache(); 274 $dir = dirname($f->getAbsolutePath()); 275 return (bool) @is_writable($dir); 276 } 277 266 278 } branches/2.3/classes/phing/system/io/Win32FileSystem.php
r129 r258 473 473 } 474 474 475 /** 476 * Whether file can be deleted. 477 * 478 * This is currently returning whether the specified file is 479 * writable. This is likely wrong for NTFS file systems, but 480 * I'm not sure whether PHP can see the NTFS delete perm ... 481 * 482 * @param PhingFile $f 483 * @return boolean 484 */ 485 abstract function canDelete(PhingFile $f); 486 475 487 } 476 488
