File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # pyright: reportImportCycles=false
21import errno
32import io
43import os
Original file line number Diff line number Diff line change 1- # pyright: reportImportCycles=false
21from ctypes import (
32 c_uint16 ,
43 c_uint32 ,
Original file line number Diff line number Diff line change 1- # pyright: reportImportCycles=false
21from ctypes import (
32 addressof ,
43 c_char ,
Original file line number Diff line number Diff line change 1- # pyright: reportImportCycles=false
21from ctypes import (
32 c_uint8 ,
43 c_uint16 ,
Original file line number Diff line number Diff line change 1- # pyright: reportImportCycles=false
21from collections .abc import Iterator
32from ctypes import (
43 c_uint16 ,
Original file line number Diff line number Diff line change 1- # pyright: reportImportCycles=false
21import warnings
32from collections .abc import Generator
43from ctypes import (
Original file line number Diff line number Diff line change 1- # pyright: reportImportCycles=false
21from __future__ import annotations
32
43import errno
@@ -482,8 +481,17 @@ def open(
482481
483482
484483class SymbolicLink (Inode ):
484+ @property
485+ def is_fast_symlink (self ) -> bool :
486+ i_blocks_lo = assert_cast (self .i_blocks_lo , int ) # pyright: ignore[reportAny]
487+ return i_blocks_lo == 0 and not self .is_inline
488+
485489 def readlink (self ) -> bytes :
486- return self ._open ().read ()
490+ if not self .is_fast_symlink :
491+ return self ._open ().read ()
492+
493+ _ = self .volume .seek (self .offset + Inode .i_block .offset )
494+ return self .volume .read (self .i_size )
487495
488496
489497class Directory (Inode ):
Original file line number Diff line number Diff line change 1- # pyright: reportImportCycles=false
21import ctypes
32import errno
43import warnings
Original file line number Diff line number Diff line change 1- # pyright: reportImportCycles=false
21from ctypes import (
32 c_ubyte ,
43 c_uint8 ,
Original file line number Diff line number Diff line change @@ -91,3 +91,4 @@ ignore = [
9191[tool .pyright ]
9292exclude = [" .venv" , " build" ]
9393reportMissingTypeStubs = false
94+ reportImportCycles = false
You can’t perform that action at this time.
0 commit comments