本文整理了Java中jnr.posix.POSIX.ftruncate()
方法的一些代码示例,展示了POSIX.ftruncate()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。POSIX.ftruncate()
方法的具体详情如下:
包路径:jnr.posix.POSIX
类名称:POSIX
方法名:ftruncate
暂无
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-driver
public int ftruncate(int fd, long offset) {
try {return posix.ftruncate(fd, offset); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); }
}
代码示例来源:origin: io.prestosql.cassandra/cassandra-driver
public int ftruncate(int fd, long offset) {
return posix().ftruncate(fd, offset);
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-driver
public int ftruncate(int fd, long offset) {
return posix().ftruncate(fd, offset);
}
代码示例来源:origin: com.github.jnr/jnr-posix
public int ftruncate(int fd, long offset) {
return posix().ftruncate(fd, offset);
}
代码示例来源:origin: com.github.jnr/jnr-posix
public int ftruncate(int fd, long offset) {
try {return posix.ftruncate(fd, offset); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); }
}
代码示例来源:origin: io.prestosql.cassandra/cassandra-driver
public int ftruncate(int fd, long offset) {
try {return posix.ftruncate(fd, offset); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); }
}
代码示例来源:origin: org.jruby/jruby-complete
public int ftruncate(ChannelFD fd, long pos) {
if (fd.chNative != null) {
int ret = posix.ftruncate(fd.chNative.getFD(), pos);
if (ret == -1) errno = Errno.valueOf(posix.errno());
return ret;
} else if (fd.chFile != null) {
try {
fd.chFile.truncate(pos);
} catch (IOException ioe) {
errno = Helpers.errnoFromException(ioe);
return -1;
}
} else {
errno = Errno.EINVAL;
return -1;
}
return 0;
}
代码示例来源:origin: org.jruby/jruby-core
public int ftruncate(ChannelFD fd, long pos) {
if (fd.chNative != null) {
int ret = posix.ftruncate(fd.chNative.getFD(), pos);
if (ret == -1) errno = Errno.valueOf(posix.errno());
return ret;
} else if (fd.chFile != null) {
try {
fd.chFile.truncate(pos);
} catch (IOException ioe) {
errno = Helpers.errnoFromException(ioe);
return -1;
}
} else {
errno = Errno.EINVAL;
return -1;
}
return 0;
}
代码示例来源:origin: org.python/jython
public static void ftruncate(PyObject fd, long length) {
Object javaobj = fd.__tojava__(RawIOBase.class);
if (javaobj != Py.NoConversion) {
try {
((RawIOBase) javaobj).truncate(length);
} catch (PyException pye) {
throw Py.OSError(Errno.EBADF);
}
} else {
posix.ftruncate(getFD(fd).getIntFD(), length);
}
}
内容来源于网络,如有侵权,请联系作者删除!