Creates a {@link RubyIO} by given path and mode.

@param path
of a File
@param mode
r, rw, w, w+, a, a+
@see Mode
@return {@link RubyIO}
14732
public static RubyIO open(String path, String mode) {
    RubyIO io = null;
    try {
      io = new RubyIO(new File(path), Mode.fromString(mode));
    } catch (IOException e) {
      logger.log(Level.SEVERE, null, e);
      throw new RuntimeException(e);
    }
    return io;
  }
514750
public function createDir(ConsoleIo $io, $path)
    {
        if ($this->verboseIfFileExists($io, $path)) {
            return false;
        }

        if (!@mkdir($path, 0777, true)) {
            $io->error(__d('me_tools', 'Failed to create file or directory `{0}`', rtr($path)));

            return false;
        }

        $io->verbose(__d('me_tools', 'Created `{0}` directory', rtr($path)));
        $this->folderChmod($io, $path);

        return true;
    }
1182479
public static LocalCall<String> chmod(String path, String mode) {
        return new LocalCall<>("file.set_mode", Optional.of(Arrays.asList(path, mode)),
                Optional.empty(), new TypeToken<String>(){});
    }
497829
private File withPath(Path path, File dir) {
        return new File(dir, path.getPath());
    }
169952
public Resource addPath(String path)
        throws IOException,MalformedURLException
    {
        FileResource r=null;

        if (!isDirectory())
        {
            r=(FileResource)super.addPath(path);
        }
        else
        {
            path = org.browsermob.proxy.jetty.util.URI.canonicalPath(path);
            
            // treat all paths being added as relative
            String rel=path;
            if (path.startsWith("/"))
                rel = path.substring(1);
            
            File newFile = new File(_file,rel.replace('/', File.separatorChar));
            r=new FileResource(newFile.toURI().toURL(),null,newFile);
        }
        
        String encoded= org.browsermob.proxy.jetty.util.URI.encodePath(path);
        int expected=r._urlString.length()-encoded.length();
        int index = r._urlString.lastIndexOf(encoded, expected);
        
        if (expected!=index && ((expected-1)!=index || path.endsWith("/") || !r.isDirectory()))
        {
            r._alias=r._url;
            r._aliasChecked=true;
        }                   
        return r;
    }
651092
public static FileDescriptor from(String path) throws IOException {
        checkNotNull(path, "path");
        int res = open(path);
        if (res < 0) {
            throw newIOException("open", res);
        }
        return new FileDescriptor(res);
    }
1255364
@Override
	public FSDataOutputStream create(Path f, WriteMode overwriteMode) throws IOException {
		return createOutputStream(() -> originalFs.create(f, overwriteMode));
	}
1305053
def createpath(path, mode, exists_ok=True):
    
    try:
        os.makedirs(path, mode)
    except OSError, e:
        if e.errno != errno.EEXIST or not exists_ok:
            raise e
1059167
public static function createDir($dirPath, $mode = 0711)
    {
        if (false === file_exists($dirPath)) {
            if (false === mkdir($dirPath, $mode, true)) {
                throw new RuntimeException(sprintf('unable to create directory "%s"', $dirPath));
            }
        }
    }
987615
public function create($filepath, $mode = "w")
    {
        //@1 Fopen cannot create directories,
        //so if trying to create a file in subfolders that don't exist will throw a warning
        //wewill first create these directories;
        $dirname = dirname($filepath);

        if (!is_dir($dirname)) {
            if (mkdir($dirname, 0755, true)) {
                return $dirname;
            } else {
                return false;
            }
        }

        //@2 Attempt to create the file
        if (!($file = $this->getFileStream($filepath, $mode))) {
            return false;
        }

        return $file;
    }
1336555
public static ClassFileReader newInstance(Path path, JarFile jf) throws IOException {
        return new JarFileReader(path, jf);
    }
1268876
private void createDirAndFile(Path path) throws IOException {
			// create dir and file first if dir/file not exist
			File file = new File(path.toAbsolutePath().toString());
			File dir = file.getParentFile();
			if (dir != null && !dir.exists()) {
				dir.mkdirs();
			}
			if (!file.exists()) {
				file.createNewFile();
			}
	}
1144205
public static AiffData create(URL path) {
		try {
			return create(
				AudioSystem.getAudioInputStream(
					new BufferedInputStream(path.openStream())));
		} catch (Exception e) {
			org.lwjgl.LWJGLUtil.log("Unable to create from: " + path);
			e.printStackTrace();
			return null;
		}		
	}
604693
def set_mode(path, mode):
    '''
    
    '''
    path = os.path.expanduser(path)

    mode = six.text_type(mode).lstrip('0Oo')
    if not mode:
        mode = '0'
    if not os.path.exists(path):
        raise CommandExecutionError('{0}: File not found'.format(path))
    try:
        os.chmod(path, int(mode, 8))
    except Exception:
        return 'Invalid Mode ' + mode
    return get_mode(path)
1002785
public static ByteArray createByteArray(String path)
    {
        byte[] bytes = IOUtil.readBytes(path);
        if (bytes == null) return null;
        return new ByteArray(bytes);
    }
720485
private static void createDirectory(Path path) throws IOException {
		try {
			Files.createDirectory(path);
		} catch (FileAlreadyExistsException e) {
			if (!Files.isDirectory(path)) {
				throw e;
			}
		}
	}
485819
public static void createFile(String filePath) throws IOException {
    Path storagePath = Paths.get(filePath);
    Files.createDirectories(storagePath.getParent());
    Files.createFile(storagePath);
  }