本文整理汇总了Java中com.sun.squawk.platform.windows.natives.LibC类的典型用法代码示例。如果您正苦于以下问题:Java LibC类的具体用法?Java LibC怎么用?Java LibC使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LibC类属于com.sun.squawk.platform.windows.natives包,在下文中一共展示了LibC类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isDirectory
import com.sun.squawk.platform.windows.natives.LibC; //导入依赖的package包/类
/**
* Check is file corresponding to this filehandler exists and is a
* directory.
* @return <code>true</code> if pathname is a directory
*/
public boolean isDirectory() {
stat stats = new stat();
if (libc.stat(nativeFileName, stats) != -1) {
return (stats.st_mode & LibC.S_IFMT) == LibC.S_IFDIR;
} else {
return false;
}
}
示例2: create
import com.sun.squawk.platform.windows.natives.LibC; //导入依赖的package包/类
public void create() throws IOException {
// @TODO: Check that file isn't dir first?
int tHandle = libc.open(nativeFileName, (LibC.O_WRONLY | LibC.O_CREAT | LibC.O_TRUNC), 0666);
//System.err.println("openForWrite: " + writeHandle);
LibCUtil.errCheckNeg(tHandle);
libc.close(tHandle);
}
示例3: openForRead
import com.sun.squawk.platform.windows.natives.LibC; //导入依赖的package包/类
/**
* Opens the file for reading.
* @throws IOException if any error occurs during input/output operations.
*/
public void openForRead() throws IOException {
// @TODO: Check that file isn't dir first?
readHandle = libc.open(nativeFileName, LibC.O_RDONLY, 0);
LibCUtil.errCheckNeg(readHandle);
}
示例4: openForWrite
import com.sun.squawk.platform.windows.natives.LibC; //导入依赖的package包/类
/**
* Opens the file for writing.
* @throws IOException if any error occurs during input/output operations.
*/
public void openForWrite() throws IOException {
// @TODO: Check that file isn't dir first?
writeHandle = libc.open(nativeFileName, LibC.O_WRONLY, 0666);
LibCUtil.errCheckNeg(writeHandle);
}