Tabnine Logo
Os.stat
Code IndexAdd Tabnine to your IDE (free)

How to use
stat
method
in
libcore.io.Os

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

origin: robovm/robovm

/**
 * Returns the time when this file was last modified, measured in
 * milliseconds since January 1st, 1970, midnight.
 * Returns 0 if the file does not exist.
 *
 * @return the time when this file was last modified.
 */
public long lastModified() {
  try {
    return Libcore.os.stat(path).st_mtime * 1000L;
  } catch (ErrnoException errnoException) {
    // The RI returns 0 on error. (Even for errors like EACCES or ELOOP.)
    return 0;
  }
}
origin: robovm/robovm

/**
 * Returns the length of this file in bytes.
 * Returns 0 if the file does not exist.
 * The result for a directory is not defined.
 *
 * @return the number of bytes in this file.
 */
public long length() {
  try {
    return Libcore.os.stat(path).st_size;
  } catch (ErrnoException errnoException) {
    // The RI returns 0 on error. (Even for errors like EACCES or ELOOP.)
    return 0;
  }
}
origin: robovm/robovm

public StructStat stat(String path) throws ErrnoException { return os.stat(path); }
public StructStatVfs statvfs(String path) throws ErrnoException { return os.statvfs(path); }
origin: robovm/robovm

private boolean doChmod(int mask, boolean set) {
  try {
    StructStat sb = Libcore.os.stat(path);
    int newMode = set ? (sb.st_mode | mask) : (sb.st_mode & ~mask);
    Libcore.os.chmod(path, newMode);
    return true;
  } catch (ErrnoException errnoException) {
    return false;
  }
}
origin: robovm/robovm

/**
 * Indicates if this file represents a <em>file</em> on the underlying
 * file system.
 *
 * @return {@code true} if this file is a file, {@code false} otherwise.
 */
public boolean isFile() {
  try {
    return S_ISREG(Libcore.os.stat(path).st_mode);
  } catch (ErrnoException errnoException) {
    // The RI returns false on error. (Even for errors like EACCES or ELOOP.)
    return false;
  }
}
origin: robovm/robovm

/**
 * Indicates if this file represents a <em>directory</em> on the
 * underlying file system.
 *
 * @return {@code true} if this file is a directory, {@code false}
 *         otherwise.
 */
public boolean isDirectory() {
  try {
    return S_ISDIR(Libcore.os.stat(path).st_mode);
  } catch (ErrnoException errnoException) {
    // The RI returns false on error. (Even for errors like EACCES or ELOOP.)
    return false;
  }
}
origin: MobiVM/robovm

/**
 * Returns the time when this file was last modified, measured in
 * milliseconds since January 1st, 1970, midnight.
 * Returns 0 if the file does not exist.
 *
 * @return the time when this file was last modified.
 */
public long lastModified() {
  try {
    return Libcore.os.stat(path).st_mtime * 1000L;
  } catch (ErrnoException errnoException) {
    // The RI returns 0 on error. (Even for errors like EACCES or ELOOP.)
    return 0;
  }
}
origin: MobiVM/robovm

public StructStat stat(String path) throws ErrnoException { return os.stat(path); }
public StructStatVfs statvfs(String path) throws ErrnoException { return os.statvfs(path); }
origin: com.bugvm/bugvm-rt

/**
 * Returns the length of this file in bytes.
 * Returns 0 if the file does not exist.
 * The result for a directory is not defined.
 *
 * @return the number of bytes in this file.
 */
public long length() {
  try {
    return Libcore.os.stat(path).st_size;
  } catch (ErrnoException errnoException) {
    // The RI returns 0 on error. (Even for errors like EACCES or ELOOP.)
    return 0;
  }
}
origin: com.bugvm/bugvm-rt

public StructStat stat(String path) throws ErrnoException { return os.stat(path); }
public StructStatVfs statvfs(String path) throws ErrnoException { return os.statvfs(path); }
origin: MobiVM/robovm

private boolean doChmod(int mask, boolean set) {
  try {
    StructStat sb = Libcore.os.stat(path);
    int newMode = set ? (sb.st_mode | mask) : (sb.st_mode & ~mask);
    Libcore.os.chmod(path, newMode);
    return true;
  } catch (ErrnoException errnoException) {
    return false;
  }
}
origin: ibinti/bugvm

private boolean doChmod(int mask, boolean set) {
  try {
    StructStat sb = Libcore.os.stat(path);
    int newMode = set ? (sb.st_mode | mask) : (sb.st_mode & ~mask);
    Libcore.os.chmod(path, newMode);
    return true;
  } catch (ErrnoException errnoException) {
    return false;
  }
}
origin: FlexoVM/flexovm

private boolean doChmod(int mask, boolean set) {
  try {
    StructStat sb = Libcore.os.stat(path);
    int newMode = set ? (sb.st_mode | mask) : (sb.st_mode & ~mask);
    Libcore.os.chmod(path, newMode);
    return true;
  } catch (ErrnoException errnoException) {
    return false;
  }
}
origin: com.gluonhq/robovm-rt

private boolean doChmod(int mask, boolean set) {
  try {
    StructStat sb = Libcore.os.stat(path);
    int newMode = set ? (sb.st_mode | mask) : (sb.st_mode & ~mask);
    Libcore.os.chmod(path, newMode);
    return true;
  } catch (ErrnoException errnoException) {
    return false;
  }
}
origin: com.bugvm/bugvm-rt

private boolean doChmod(int mask, boolean set) {
  try {
    StructStat sb = Libcore.os.stat(path);
    int newMode = set ? (sb.st_mode | mask) : (sb.st_mode & ~mask);
    Libcore.os.chmod(path, newMode);
    return true;
  } catch (ErrnoException errnoException) {
    return false;
  }
}
origin: com.mobidevelop.robovm/robovm-rt

private boolean doChmod(int mask, boolean set) {
  try {
    StructStat sb = Libcore.os.stat(path);
    int newMode = set ? (sb.st_mode | mask) : (sb.st_mode & ~mask);
    Libcore.os.chmod(path, newMode);
    return true;
  } catch (ErrnoException errnoException) {
    return false;
  }
}
origin: MobiVM/robovm

/**
 * Indicates if this file represents a <em>file</em> on the underlying
 * file system.
 *
 * @return {@code true} if this file is a file, {@code false} otherwise.
 */
public boolean isFile() {
  try {
    return S_ISREG(Libcore.os.stat(path).st_mode);
  } catch (ErrnoException errnoException) {
    // The RI returns false on error. (Even for errors like EACCES or ELOOP.)
    return false;
  }
}
origin: com.gluonhq/robovm-rt

/**
 * Indicates if this file represents a <em>file</em> on the underlying
 * file system.
 *
 * @return {@code true} if this file is a file, {@code false} otherwise.
 */
public boolean isFile() {
  try {
    return S_ISREG(Libcore.os.stat(path).st_mode);
  } catch (ErrnoException errnoException) {
    // The RI returns false on error. (Even for errors like EACCES or ELOOP.)
    return false;
  }
}
origin: MobiVM/robovm

/**
 * Indicates if this file represents a <em>directory</em> on the
 * underlying file system.
 *
 * @return {@code true} if this file is a directory, {@code false}
 *         otherwise.
 */
public boolean isDirectory() {
  try {
    return S_ISDIR(Libcore.os.stat(path).st_mode);
  } catch (ErrnoException errnoException) {
    // The RI returns false on error. (Even for errors like EACCES or ELOOP.)
    return false;
  }
}
origin: ibinti/bugvm

/**
 * Indicates if this file represents a <em>file</em> on the underlying
 * file system.
 *
 * @return {@code true} if this file is a file, {@code false} otherwise.
 */
public boolean isFile() {
  try {
    return S_ISREG(Libcore.os.stat(path).st_mode);
  } catch (ErrnoException errnoException) {
    // The RI returns false on error. (Even for errors like EACCES or ELOOP.)
    return false;
  }
}
libcore.ioOsstat

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

  • Finding current android device location
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setContentView (Activity)
  • runOnUiThread (Activity)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Option (scala)
  • 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