ホーム › System.SystemServices › FILE_STAT_LX_INFORMATION
FILE_STAT_LX_INFORMATION
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| FileId | LONGLONG | 8 | +0 | +0 | ファイルを一意に識別するファイルID。 |
| CreationTime | LONGLONG | 8 | +8 | +8 | ファイル作成日時。 |
| LastAccessTime | LONGLONG | 8 | +16 | +16 | 最終アクセス日時。 |
| LastWriteTime | LONGLONG | 8 | +24 | +24 | 最終書き込み日時。 |
| ChangeTime | LONGLONG | 8 | +32 | +32 | 最終属性変更日時。 |
| AllocationSize | LONGLONG | 8 | +40 | +40 | ファイルに割り当てられたサイズをバイト単位で示す。 |
| EndOfFile | LONGLONG | 8 | +48 | +48 | ファイル末尾位置(実サイズ)をバイト単位で示す。 |
| FileAttributes | DWORD | 4 | +56 | +56 | ファイル属性フラグ。 |
| ReparseTag | DWORD | 4 | +60 | +60 | 再解析ポイントのタグ値。 |
| NumberOfLinks | DWORD | 4 | +64 | +64 | ファイルへのハードリンク数。 |
| EffectiveAccess | DWORD | 4 | +68 | +68 | 呼び出し元に許可された実効アクセス権。 |
| LxFlags | DWORD | 4 | +72 | +72 | Linuxサブシステム(WSL)メタデータの有効性を示すフラグ。 |
| LxUid | DWORD | 4 | +76 | +76 | WSLにおけるファイル所有者のUID。 |
| LxGid | DWORD | 4 | +80 | +80 | WSLにおけるファイル所有グループのGID。 |
| LxMode | DWORD | 4 | +84 | +84 | WSLにおけるファイルのモード(パーミッション)。 |
| LxDeviceIdMajor | DWORD | 4 | +88 | +88 | デバイスファイルのメジャーデバイスID。 |
| LxDeviceIdMinor | DWORD | 4 | +92 | +92 | デバイスファイルのマイナーデバイスID。 |
各言語での定義
#include <windows.h>
// FILE_STAT_LX_INFORMATION (x64 96 / x86 96 バイト)
typedef struct FILE_STAT_LX_INFORMATION {
LONGLONG FileId;
LONGLONG CreationTime;
LONGLONG LastAccessTime;
LONGLONG LastWriteTime;
LONGLONG ChangeTime;
LONGLONG AllocationSize;
LONGLONG EndOfFile;
DWORD FileAttributes;
DWORD ReparseTag;
DWORD NumberOfLinks;
DWORD EffectiveAccess;
DWORD LxFlags;
DWORD LxUid;
DWORD LxGid;
DWORD LxMode;
DWORD LxDeviceIdMajor;
DWORD LxDeviceIdMinor;
} FILE_STAT_LX_INFORMATION;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FILE_STAT_LX_INFORMATION
{
public long FileId;
public long CreationTime;
public long LastAccessTime;
public long LastWriteTime;
public long ChangeTime;
public long AllocationSize;
public long EndOfFile;
public uint FileAttributes;
public uint ReparseTag;
public uint NumberOfLinks;
public uint EffectiveAccess;
public uint LxFlags;
public uint LxUid;
public uint LxGid;
public uint LxMode;
public uint LxDeviceIdMajor;
public uint LxDeviceIdMinor;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FILE_STAT_LX_INFORMATION
Public FileId As Long
Public CreationTime As Long
Public LastAccessTime As Long
Public LastWriteTime As Long
Public ChangeTime As Long
Public AllocationSize As Long
Public EndOfFile As Long
Public FileAttributes As UInteger
Public ReparseTag As UInteger
Public NumberOfLinks As UInteger
Public EffectiveAccess As UInteger
Public LxFlags As UInteger
Public LxUid As UInteger
Public LxGid As UInteger
Public LxMode As UInteger
Public LxDeviceIdMajor As UInteger
Public LxDeviceIdMinor As UInteger
End Structureimport ctypes
from ctypes import wintypes
class FILE_STAT_LX_INFORMATION(ctypes.Structure):
_fields_ = [
("FileId", ctypes.c_longlong),
("CreationTime", ctypes.c_longlong),
("LastAccessTime", ctypes.c_longlong),
("LastWriteTime", ctypes.c_longlong),
("ChangeTime", ctypes.c_longlong),
("AllocationSize", ctypes.c_longlong),
("EndOfFile", ctypes.c_longlong),
("FileAttributes", wintypes.DWORD),
("ReparseTag", wintypes.DWORD),
("NumberOfLinks", wintypes.DWORD),
("EffectiveAccess", wintypes.DWORD),
("LxFlags", wintypes.DWORD),
("LxUid", wintypes.DWORD),
("LxGid", wintypes.DWORD),
("LxMode", wintypes.DWORD),
("LxDeviceIdMajor", wintypes.DWORD),
("LxDeviceIdMinor", wintypes.DWORD),
]#[repr(C)]
pub struct FILE_STAT_LX_INFORMATION {
pub FileId: i64,
pub CreationTime: i64,
pub LastAccessTime: i64,
pub LastWriteTime: i64,
pub ChangeTime: i64,
pub AllocationSize: i64,
pub EndOfFile: i64,
pub FileAttributes: u32,
pub ReparseTag: u32,
pub NumberOfLinks: u32,
pub EffectiveAccess: u32,
pub LxFlags: u32,
pub LxUid: u32,
pub LxGid: u32,
pub LxMode: u32,
pub LxDeviceIdMajor: u32,
pub LxDeviceIdMinor: u32,
}import "golang.org/x/sys/windows"
type FILE_STAT_LX_INFORMATION struct {
FileId int64
CreationTime int64
LastAccessTime int64
LastWriteTime int64
ChangeTime int64
AllocationSize int64
EndOfFile int64
FileAttributes uint32
ReparseTag uint32
NumberOfLinks uint32
EffectiveAccess uint32
LxFlags uint32
LxUid uint32
LxGid uint32
LxMode uint32
LxDeviceIdMajor uint32
LxDeviceIdMinor uint32
}type
FILE_STAT_LX_INFORMATION = record
FileId: Int64;
CreationTime: Int64;
LastAccessTime: Int64;
LastWriteTime: Int64;
ChangeTime: Int64;
AllocationSize: Int64;
EndOfFile: Int64;
FileAttributes: DWORD;
ReparseTag: DWORD;
NumberOfLinks: DWORD;
EffectiveAccess: DWORD;
LxFlags: DWORD;
LxUid: DWORD;
LxGid: DWORD;
LxMode: DWORD;
LxDeviceIdMajor: DWORD;
LxDeviceIdMinor: DWORD;
end;const FILE_STAT_LX_INFORMATION = extern struct {
FileId: i64,
CreationTime: i64,
LastAccessTime: i64,
LastWriteTime: i64,
ChangeTime: i64,
AllocationSize: i64,
EndOfFile: i64,
FileAttributes: u32,
ReparseTag: u32,
NumberOfLinks: u32,
EffectiveAccess: u32,
LxFlags: u32,
LxUid: u32,
LxGid: u32,
LxMode: u32,
LxDeviceIdMajor: u32,
LxDeviceIdMinor: u32,
};type
FILE_STAT_LX_INFORMATION {.bycopy.} = object
FileId: int64
CreationTime: int64
LastAccessTime: int64
LastWriteTime: int64
ChangeTime: int64
AllocationSize: int64
EndOfFile: int64
FileAttributes: uint32
ReparseTag: uint32
NumberOfLinks: uint32
EffectiveAccess: uint32
LxFlags: uint32
LxUid: uint32
LxGid: uint32
LxMode: uint32
LxDeviceIdMajor: uint32
LxDeviceIdMinor: uint32struct FILE_STAT_LX_INFORMATION
{
long FileId;
long CreationTime;
long LastAccessTime;
long LastWriteTime;
long ChangeTime;
long AllocationSize;
long EndOfFile;
uint FileAttributes;
uint ReparseTag;
uint NumberOfLinks;
uint EffectiveAccess;
uint LxFlags;
uint LxUid;
uint LxGid;
uint LxMode;
uint LxDeviceIdMajor;
uint LxDeviceIdMinor;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; FILE_STAT_LX_INFORMATION サイズ: 96 バイト(x64)
dim st, 24 ; 4byte整数×24(構造体サイズ 96 / 4 切り上げ)
; FileId : LONGLONG (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; CreationTime : LONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; LastAccessTime : LONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; LastWriteTime : LONGLONG (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; ChangeTime : LONGLONG (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; AllocationSize : LONGLONG (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; EndOfFile : LONGLONG (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; FileAttributes : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; ReparseTag : DWORD (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; NumberOfLinks : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; EffectiveAccess : DWORD (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; LxFlags : DWORD (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; LxUid : DWORD (+76, 4byte) st.19 = 値 / 値 = st.19 (lpoke/lpeek も可)
; LxGid : DWORD (+80, 4byte) st.20 = 値 / 値 = st.20 (lpoke/lpeek も可)
; LxMode : DWORD (+84, 4byte) st.21 = 値 / 値 = st.21 (lpoke/lpeek も可)
; LxDeviceIdMajor : DWORD (+88, 4byte) st.22 = 値 / 値 = st.22 (lpoke/lpeek も可)
; LxDeviceIdMinor : DWORD (+92, 4byte) st.23 = 値 / 値 = st.23 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global FILE_STAT_LX_INFORMATION
#field int64 FileId
#field int64 CreationTime
#field int64 LastAccessTime
#field int64 LastWriteTime
#field int64 ChangeTime
#field int64 AllocationSize
#field int64 EndOfFile
#field int FileAttributes
#field int ReparseTag
#field int NumberOfLinks
#field int EffectiveAccess
#field int LxFlags
#field int LxUid
#field int LxGid
#field int LxMode
#field int LxDeviceIdMajor
#field int LxDeviceIdMinor
#endstruct
stdim st, FILE_STAT_LX_INFORMATION ; NSTRUCT 変数を確保
st->FileId = 100
mes "FileId=" + st->FileId