congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Os.open
Code IndexAdd Tabnine to your IDE (free)

How to use
open
method
in
libcore.io.Os

Best Java code snippets using libcore.io.Os.open (Showing top 20 results out of 315)

origin: robovm/robovm

public FileDescriptor open(String path, int flags, int mode) throws ErrnoException { return os.open(path, flags, mode); }
public FileDescriptor[] pipe() throws ErrnoException { return os.pipe(); }
origin: robovm/robovm

/**
 * Do not use. This is for System.loadLibrary use only.
 *
 * Checks whether {@code path} can be opened read-only. Similar to File.exists, but doesn't
 * require read permission on the parent, so it'll work in more cases, and allow you to
 * remove read permission from more directories. Everyone else should just open(2) and then
 * use the fd, but the loadLibrary API is broken by its need to ask ClassLoaders where to
 * find a .so rather than just calling dlopen(3).
 */
public static boolean canOpenReadOnly(String path) {
  try {
    // Use open(2) rather than stat(2) so we require fewer permissions. http://b/6485312.
    FileDescriptor fd = Libcore.os.open(path, O_RDONLY, 0);
    Libcore.os.close(fd);
    return true;
  } catch (ErrnoException errnoException) {
    return false;
  }
}
origin: robovm/robovm

try {
  fd = Libcore.os.open(path, O_RDWR | O_CREAT | O_EXCL, 0600);
  return true;
} catch (ErrnoException errnoException) {
origin: robovm/robovm

@Override public FileDescriptor open(String path, int flags, int mode) throws ErrnoException {
  BlockGuard.getThreadPolicy().onReadFromDisk();
  if ((mode & O_ACCMODE) != O_RDONLY) {
    BlockGuard.getThreadPolicy().onWriteToDisk();
  }
  return os.open(path, flags, mode);
}
origin: robovm/robovm

/**
 * Use this to mmap the whole file read-only.
 */
public static MemoryMappedFile mmapRO(String path) throws ErrnoException {
  FileDescriptor fd = Libcore.os.open(path, O_RDONLY, 0);
  long size = Libcore.os.fstat(fd).st_size;
  long address = Libcore.os.mmap(0L, size, PROT_READ, MAP_SHARED, fd, 0);
  Libcore.os.close(fd);
  return new MemoryMappedFile(address, size);
}
origin: robovm/robovm

fd = Libcore.os.open(path, flags, mode);
if (fd.valid()) {
origin: com.mobidevelop.robovm/robovm-rt

public FileDescriptor open(String path, int flags, int mode) throws ErrnoException { return os.open(path, flags, mode); }
public FileDescriptor[] pipe() throws ErrnoException { return os.pipe(); }
origin: com.bugvm/bugvm-rt

public FileDescriptor open(String path, int flags, int mode) throws ErrnoException { return os.open(path, flags, mode); }
public FileDescriptor[] pipe() throws ErrnoException { return os.pipe(); }
origin: MobiVM/robovm

@Override public FileDescriptor open(String path, int flags, int mode) throws ErrnoException {
  BlockGuard.getThreadPolicy().onReadFromDisk();
  if ((mode & O_ACCMODE) != O_RDONLY) {
    BlockGuard.getThreadPolicy().onWriteToDisk();
  }
  return os.open(path, flags, mode);
}
origin: MobiVM/robovm

/**
 * Use this to mmap the whole file read-only.
 */
public static MemoryMappedFile mmapRO(String path) throws ErrnoException {
  FileDescriptor fd = Libcore.os.open(path, O_RDONLY, 0);
  long size = Libcore.os.fstat(fd).st_size;
  long address = Libcore.os.mmap(0L, size, PROT_READ, MAP_SHARED, fd, 0);
  Libcore.os.close(fd);
  return new MemoryMappedFile(address, size);
}
origin: com.mobidevelop.robovm/robovm-rt

@Override public FileDescriptor open(String path, int flags, int mode) throws ErrnoException {
  BlockGuard.getThreadPolicy().onReadFromDisk();
  if ((mode & O_ACCMODE) != O_RDONLY) {
    BlockGuard.getThreadPolicy().onWriteToDisk();
  }
  return os.open(path, flags, mode);
}
origin: ibinti/bugvm

@Override public FileDescriptor open(String path, int flags, int mode) throws ErrnoException {
  BlockGuard.getThreadPolicy().onReadFromDisk();
  if ((mode & O_ACCMODE) != O_RDONLY) {
    BlockGuard.getThreadPolicy().onWriteToDisk();
  }
  return os.open(path, flags, mode);
}
origin: ibinti/bugvm

/**
 * Use this to mmap the whole file read-only.
 */
public static MemoryMappedFile mmapRO(String path) throws ErrnoException {
  FileDescriptor fd = Libcore.os.open(path, O_RDONLY, 0);
  long size = Libcore.os.fstat(fd).st_size;
  long address = Libcore.os.mmap(0L, size, PROT_READ, MAP_SHARED, fd, 0);
  Libcore.os.close(fd);
  return new MemoryMappedFile(address, size);
}
origin: FlexoVM/flexovm

/**
 * Use this to mmap the whole file read-only.
 */
public static MemoryMappedFile mmapRO(String path) throws ErrnoException {
  FileDescriptor fd = Libcore.os.open(path, O_RDONLY, 0);
  long size = Libcore.os.fstat(fd).st_size;
  long address = Libcore.os.mmap(0L, size, PROT_READ, MAP_SHARED, fd, 0);
  Libcore.os.close(fd);
  return new MemoryMappedFile(address, size);
}
origin: com.bugvm/bugvm-rt

/**
 * Use this to mmap the whole file read-only.
 */
public static MemoryMappedFile mmapRO(String path) throws ErrnoException {
  FileDescriptor fd = Libcore.os.open(path, O_RDONLY, 0);
  long size = Libcore.os.fstat(fd).st_size;
  long address = Libcore.os.mmap(0L, size, PROT_READ, MAP_SHARED, fd, 0);
  Libcore.os.close(fd);
  return new MemoryMappedFile(address, size);
}
origin: com.mobidevelop.robovm/robovm-rt

/**
 * Use this to mmap the whole file read-only.
 */
public static MemoryMappedFile mmapRO(String path) throws ErrnoException {
  FileDescriptor fd = Libcore.os.open(path, O_RDONLY, 0);
  long size = Libcore.os.fstat(fd).st_size;
  long address = Libcore.os.mmap(0L, size, PROT_READ, MAP_SHARED, fd, 0);
  Libcore.os.close(fd);
  return new MemoryMappedFile(address, size);
}
origin: com.gluonhq/robovm-rt

/**
 * Use this to mmap the whole file read-only.
 */
public static MemoryMappedFile mmapRO(String path) throws ErrnoException {
  FileDescriptor fd = Libcore.os.open(path, O_RDONLY, 0);
  long size = Libcore.os.fstat(fd).st_size;
  long address = Libcore.os.mmap(0L, size, PROT_READ, MAP_SHARED, fd, 0);
  Libcore.os.close(fd);
  return new MemoryMappedFile(address, size);
}
origin: com.bugvm/bugvm-rt

@Override public FileDescriptor open(String path, int flags, int mode) throws ErrnoException {
  BlockGuard.getThreadPolicy().onReadFromDisk();
  if ((mode & O_ACCMODE) != O_RDONLY) {
    BlockGuard.getThreadPolicy().onWriteToDisk();
  }
  return os.open(path, flags, mode);
}
origin: com.gluonhq/robovm-rt

@Override public FileDescriptor open(String path, int flags, int mode) throws ErrnoException {
  BlockGuard.getThreadPolicy().onReadFromDisk();
  if ((mode & O_ACCMODE) != O_RDONLY) {
    BlockGuard.getThreadPolicy().onWriteToDisk();
  }
  return os.open(path, flags, mode);
}
origin: FlexoVM/flexovm

@Override public FileDescriptor open(String path, int flags, int mode) throws ErrnoException {
  BlockGuard.getThreadPolicy().onReadFromDisk();
  if ((mode & O_ACCMODE) != O_RDONLY) {
    BlockGuard.getThreadPolicy().onWriteToDisk();
  }
  return os.open(path, flags, mode);
}
libcore.ioOsopen

Popular methods of Os

  • accept
  • access
  • bind
  • chmod
  • chown
  • close
  • connect
  • dup
  • dup2
  • environ
  • execv
  • execve
  • execv,
  • execve,
  • fchmod,
  • fchown,
  • fcntlFlock,
  • fcntlLong,
  • fcntlVoid,
  • fdatasync,
  • fstat,
  • fstatvfs

Popular in Java

  • Creating JSON documents from java classes using gson
  • getContentResolver (Context)
  • findViewById (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now