A path cannot point to a system critical folder, for example a root, windows or system directory. A path is also subject to other unspecified tests.
For many methods, the file name must have an extension appropriate to the type of data that is to be saved. Some methods may have a no-overwrite restriction. These additional restrictions are noted in the documentation.
Generally, when a path is judged to be not safe, a NotAllowedError exception is thrown (see Error object) and the method fails.