当前位置: 首页>>代码示例>>Java>>正文


Java LibC类代码示例

本文整理汇总了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;
    }
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:14,代码来源:GCFFileImpl.java

示例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);
    }
 
开发者ID:tomatsu,项目名称:squawk,代码行数:9,代码来源:GCFFileImpl.java

示例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);
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:10,代码来源:GCFFileImpl.java

示例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);
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:10,代码来源:GCFFileImpl.java


注:本文中的com.sun.squawk.platform.windows.natives.LibC类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。