Package ch.cern.mig.posix

Examples of ch.cern.mig.posix.FileStat


        // store the queue unique identifier
        if (System.getProperty("os.name").startsWith("Windows")) {
            id = queuePath;
        } else {
            // set id to stat->st_dev + stat->st_ino
            FileStat stat = posix.stat(queuePath);
            id = "" + stat.dev() + ":" + stat.ino();
        }
    }
View Full Code Here


                File[] inElements = element.listFiles(new RegExpFilenameFilter(
                        Pattern.compile("\\."), false));
                if (inElements == null)
                    continue;
                for (File inElement : inElements) {
                    FileStat stat = null;
                    try {
                        stat = posix.stat(inElement.getPath());
                    } catch (LastErrorException e) {
                        if (Posix.getErrorCode(e) == BasePosix.ENOENT)
                            continue;
                        throw new IOException(String.format(
                                "cannot stat(%s): %s", inElement,
                                e.getMessage()));
                    }
                    if (inElement.getName().endsWith(TEMPORARY_SUFFIX)
                            && stat.mtime() >= oldtemp)
                        continue;
                    if (inElement.getName().endsWith(LOCKED_SUFFIX)
                            && stat.mtime() >= oldlock)
                        continue;
                    warn("removing too old volatile file: " + inElement);
                    try {
                        posix.unlink(inElement.getPath());
                    } catch (LastErrorException e) {
View Full Code Here

        // store the queue unique identifier
        if (System.getProperty("os.name").startsWith("Windows")) {
            id = queuePath;
        } else {
            // set id to stat->st_dev + stat->st_ino
            FileStat stat = posix.stat(queuePath);
            id = "" + stat.dev() + ":" + stat.ino();
        }
    }
View Full Code Here

                File[] inElements = element.listFiles(new RegExpFilenameFilter(
                        Pattern.compile("\\."), false));
                if (inElements == null)
                    continue;
                for (File inElement : inElements) {
                    FileStat stat = null;
                    try {
                        stat = posix.stat(inElement.getPath());
                    } catch (LastErrorException e) {
                        if (Posix.getErrorCode(e) == BasePosix.ENOENT)
                            continue;
                        throw new IOException(String.format(
                                "cannot stat(%s): %s", inElement,
                                e.getMessage()));
                    }
                    if (inElement.getName().endsWith(TEMPORARY_SUFFIX)
                            && stat.mtime() >= oldtemp)
                        continue;
                    if (inElement.getName().endsWith(LOCKED_SUFFIX)
                            && stat.mtime() >= oldlock)
                        continue;
                    warn("removing too old volatile file: " + inElement);
                    try {
                        posix.unlink(inElement.getPath());
                    } catch (LastErrorException e) {
View Full Code Here

    // store the queue unique identifier
    if (System.getProperty("os.name").startsWith("Windows")) {
      id = queuePath;
    } else {
      // set id to stat->st_dev + stat->st_ino
      FileStat stat = posix.stat(queuePath);
      id = "" + stat.dev() + ":" + stat.ino();
    }
  }
View Full Code Here

        File[] inElements = element.listFiles(new RegExpFilenameFilter(
            Pattern.compile("\\."), false));
        if (inElements == null)
          continue;
        for (File inElement : inElements) {
          FileStat stat = null;
          try {
            stat = posix.stat(inElement.getPath());
          } catch (LastErrorException e) {
            throw new IOException(String.format(
                "cannot stat(%s): %s", inElement,
                e.getMessage()));
          }
          if (inElement.getName().endsWith(TEMPORARY_SUFFIX)
              && stat.mtime() >= oldtemp)
            continue;
          if (inElement.getName().endsWith(LOCKED_SUFFIX)
              && stat.mtime() >= oldlock)
            continue;
          warn("removing too old volatile file: " + inElement);
          try {
            posix.unlink(inElement.getPath());
          } catch (LastErrorException e) {
View Full Code Here

    // store the queue unique identifier
    if (System.getProperty("os.name").startsWith("Windows"))
      id = path;
    else {
      // set id to stat->st_dev + stat->st_ino
      FileStat stat = posix.stat(path);
      id = "" + stat.dev() + ":" + stat.ino();
    }
  }
View Full Code Here

        File[] inElements = element.listFiles(new RegExpFilenameFilter(
            Pattern.compile("\\."), false));
        if (inElements == null)
          continue;
        for (File inElement : inElements) {
          FileStat stat = null;
          try {
            stat = posix.stat(inElement.getPath());
          } catch (LastErrorException e) {
            throw new QueueException(String.format(
                "cannot stat(%s): %s", inElement,
                e.getMessage()));
          }
          if (inElement.getName().endsWith(TEMPORARY_SUFFIX)
              && stat.mtime() >= oldtemp)
            continue;
          if (inElement.getName().endsWith(LOCKED_SUFFIX)
              && stat.mtime() >= oldlock)
            continue;
          warn("removing too old volatile file: " + inElement);
          try {
            posix.unlink(inElement.getPath());
          } catch (LastErrorException e) {
View Full Code Here

TOP

Related Classes of ch.cern.mig.posix.FileStat

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.