Version: current

# Class Filesystem

A collection of static methods for manipulating the filesystem.

  Object
  Filesystem

Package: sapphire\filesystem
Located at sapphire/filesystem/Filesystem.php

## Methods summary

`public static` | # `makeFolder( mixed $folder )` Create a folder, recursively Create a folder, recursively
`public static` | # `removeFolder( mixed $folder, mixed $contentsOnly = false )` Remove a directory and all subdirectories and files Remove a directory and all subdirectories and files #### Parameters $folder $contentsOnly If this is true then the contents of the folder will be removed but not the folder itself $contentsOnly
`public` | # `fixfiles( )` Cleanup function to reset all the Filename fields. Visit File/fixfiles to call. Cleanup function to reset all the Filename fields. Visit File/fixfiles to call.
`public static` | # `folderModTime( mixed $folder, mixed $extensionList = null, mixed $recursiveCall = false )`
`public static` | # `isAbsolute( mixed $filename )` Returns true if the given filename is an absolute file reference. Works on Linux and Windows Returns true if the given filename is an absolute file reference. Works on Linux and Windows
`public static` | # `sync( integer $folderID = null )` This function ensures the file table is correct with the files in the assets folder. This function ensures the file table is correct with the files in the assets folder. If a Folder record ID is given, all of that folder's children will be synchronised. If the given Folder ID isn't found, or not specified at all, then everything will be synchronised from the root folder (singleton Folder). #### Parameters $folderID int $folderID Folder ID to sync along with all it's children

### Methods inherited from Object

`__call()`, `__construct()`, `__toString()`, `__wakeup()`, `addMethodsFrom()`, `addStaticVars()`, `addWrapperMethod()`, `add_extension()`, `add_static_var()`, `allMethodNames()`, `cacheToFile()`, `cacheToFileWithArgs()`, `clearCache()`, `combined_static()`, `create()`, `createMethod()`, `create_from_string()`, `defineMethods()`, `exists()`, `extInstance()`, `extend()`, `getCustomClass()`, `getExtensionInstance()`, `getExtensionInstances()`, `get_extensions()`, `get_static()`, `hasExtension()`, `hasMethod()`, `has_extension()`, `invokeWithExtensions()`, `is_a()`, `loadCache()`, `parentClass()`, `parse_class_spec()`, `remove_extension()`, `sanitiseCachename()`, `saveCache()`, `set_stat()`, `set_static()`, `set_uninherited()`, `stat()`, `strong_create()`, `uninherited()`, `uninherited_static()`, `useCustomClass()`

### Magic methods summary

## Properties summary

`public static integer` | $file_create_mask | #
`public static integer` | $folder_create_mask | #
`protected static mixed` | $cache_folderModTime | #

### Properties inherited from Object

`$class`, `$extension_instances`, `$extensions`

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -