ホーム › Storage.ProjectedFileSystem › PRJ_FILE_BASIC_INFO
PRJ_FILE_BASIC_INFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| IsDirectory | BOOLEAN | 1 | +0 | +0 | 項目がディレクトリであるかどうかを指定します。 |
| FileSize | LONGLONG | 8 | +8 | +8 | 項目のサイズ (バイト単位)。 |
| CreationTime | LONGLONG | 8 | +16 | +16 | 項目の作成日時。 |
| LastAccessTime | LONGLONG | 8 | +24 | +24 | 項目が最後にアクセスされた日時。 |
| LastWriteTime | LONGLONG | 8 | +32 | +32 | 項目が最後に書き込まれた日時。 |
| ChangeTime | LONGLONG | 8 | +40 | +40 | 項目が最後に変更された日時。 |
| FileAttributes | DWORD | 4 | +48 | +48 | 項目の属性。 |
公式ドキュメント
項目に関する基本情報です。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// PRJ_FILE_BASIC_INFO (x64 56 / x86 56 バイト)
typedef struct PRJ_FILE_BASIC_INFO {
BOOLEAN IsDirectory;
LONGLONG FileSize;
LONGLONG CreationTime;
LONGLONG LastAccessTime;
LONGLONG LastWriteTime;
LONGLONG ChangeTime;
DWORD FileAttributes;
} PRJ_FILE_BASIC_INFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct PRJ_FILE_BASIC_INFO
{
[MarshalAs(UnmanagedType.U1)] public bool IsDirectory;
public long FileSize;
public long CreationTime;
public long LastAccessTime;
public long LastWriteTime;
public long ChangeTime;
public uint FileAttributes;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure PRJ_FILE_BASIC_INFO
<MarshalAs(UnmanagedType.U1)> Public IsDirectory As Boolean
Public FileSize As Long
Public CreationTime As Long
Public LastAccessTime As Long
Public LastWriteTime As Long
Public ChangeTime As Long
Public FileAttributes As UInteger
End Structureimport ctypes
from ctypes import wintypes
class PRJ_FILE_BASIC_INFO(ctypes.Structure):
_fields_ = [
("IsDirectory", ctypes.c_byte),
("FileSize", ctypes.c_longlong),
("CreationTime", ctypes.c_longlong),
("LastAccessTime", ctypes.c_longlong),
("LastWriteTime", ctypes.c_longlong),
("ChangeTime", ctypes.c_longlong),
("FileAttributes", wintypes.DWORD),
]#[repr(C)]
pub struct PRJ_FILE_BASIC_INFO {
pub IsDirectory: u8,
pub FileSize: i64,
pub CreationTime: i64,
pub LastAccessTime: i64,
pub LastWriteTime: i64,
pub ChangeTime: i64,
pub FileAttributes: u32,
}import "golang.org/x/sys/windows"
type PRJ_FILE_BASIC_INFO struct {
IsDirectory byte
FileSize int64
CreationTime int64
LastAccessTime int64
LastWriteTime int64
ChangeTime int64
FileAttributes uint32
}type
PRJ_FILE_BASIC_INFO = record
IsDirectory: ByteBool;
FileSize: Int64;
CreationTime: Int64;
LastAccessTime: Int64;
LastWriteTime: Int64;
ChangeTime: Int64;
FileAttributes: DWORD;
end;const PRJ_FILE_BASIC_INFO = extern struct {
IsDirectory: u8,
FileSize: i64,
CreationTime: i64,
LastAccessTime: i64,
LastWriteTime: i64,
ChangeTime: i64,
FileAttributes: u32,
};type
PRJ_FILE_BASIC_INFO {.bycopy.} = object
IsDirectory: uint8
FileSize: int64
CreationTime: int64
LastAccessTime: int64
LastWriteTime: int64
ChangeTime: int64
FileAttributes: uint32struct PRJ_FILE_BASIC_INFO
{
ubyte IsDirectory;
long FileSize;
long CreationTime;
long LastAccessTime;
long LastWriteTime;
long ChangeTime;
uint FileAttributes;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; PRJ_FILE_BASIC_INFO サイズ: 56 バイト(x64)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; IsDirectory : BOOLEAN (+0, 1byte) poke st,0,値 / 値 = peek(st,0)
; FileSize : LONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; CreationTime : LONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; LastAccessTime : LONGLONG (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; LastWriteTime : LONGLONG (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; ChangeTime : LONGLONG (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; FileAttributes : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global PRJ_FILE_BASIC_INFO
#field bool1 IsDirectory
#field int64 FileSize
#field int64 CreationTime
#field int64 LastAccessTime
#field int64 LastWriteTime
#field int64 ChangeTime
#field int FileAttributes
#endstruct
stdim st, PRJ_FILE_BASIC_INFO ; NSTRUCT 変数を確保
st->IsDirectory = 100
mes "IsDirectory=" + st->IsDirectory