FatFS
FIL::fptr
is only used within FatFS.
Symbol previews are coming soon...
Symbols
loading...
Files
loading (1/5)...
Summary
Syntax
Examples
References
Call Tree
Data Use
Class Tree
Override Tree
Implementations
Instances
Lifecycle
SourceVu
ESP-IDF Framework and Examples
FatFS
FIL::fptr
FIL::fptr field
Syntax
Show:
Summary
Declaration
from
ff.h:211
FSIZE_t
fptr
;
Examples
References
from
examples
Code
Location
Referrer
FSIZE_t
fptr
;
/* File read/write pointer (Zeroed on file open) */
ff.h:211
fp
->
fptr
=
0
;
/* Set file pointer top of the file */
ff.c:3879
f_open()
fp
->
fptr
=
fp
->
obj
.
objsize
;
/* Offset to seek */
ff.c:3897
f_open()
remain
=
fp
->
obj
.
objsize
-
fp
->
fptr
;
ff.c:3971
f_read()
for
(
;
btr
>
0
;
btr
-=
rcnt
,
*
br
+=
rcnt
,
rbuff
+=
rcnt
,
fp
->
fptr
+=
rcnt
)
{
/* Repeat until btr bytes read */
ff.c:3974
f_read()
if
(
fp
->
fptr
%
SS
(
fs
)
==
0
)
{
/* On the sector boundary? */
ff.c:3975
f_read()
csect
=
(
UINT
)
(
fp
->
fptr
/
SS
(
fs
)
&
(
fs
->
csize
-
1
)
)
;
/* Sector offset in the cluster */
ff.c:3976
f_read()
if
(
fp
->
fptr
==
0
)
{
/* On the top of the file? */
ff.c:3978
f_read()
rcnt
=
SS
(
fs
)
-
(
UINT
)
fp
->
fptr
%
SS
(
fs
)
;
/* Number of bytes remains in the sector */
ff.c:4030
f_read()
memcpy
(
rbuff
,
fp
->
buf
+
fp
->
fptr
%
SS
(
fs
)
,
rcnt
)
;
/* Extract partial sector */
ff.c:4036
f_read()
if
(
(
!
FF_FS_EXFAT
||
fs
->
fs_type
!=
FS_EXFAT
)
&&
(
DWORD
)
(
fp
->
fptr
+
btw
)
<
(
DWORD
)
fp
->
fptr
)
{
ff.c:4072
f_write()
btw
=
(
UINT
)
(
0xFFFFFFFF
-
(
DWORD
)
fp
->
fptr
)
;
ff.c:4073
f_write()
for
(
;
btw
>
0
;
btw
-=
wcnt
,
*
bw
+=
wcnt
,
wbuff
+=
wcnt
,
fp
->
fptr
+=
wcnt
,
fp
->
obj
.
objsize
=
(
fp
->
fptr
>
fp
->
obj
.
objsize
)
?
fp
->
fptr
:
fp
->
obj
.
objsize
)
{
/* Repeat until all data written */
ff.c:4076
f_write()
if
(
fp
->
fptr
%
SS
(
fs
)
==
0
)
{
/* On the sector boundary? */
ff.c:4077
f_write()
csect
=
(
UINT
)
(
fp
->
fptr
/
SS
(
fs
)
)
&
(
fs
->
csize
-
1
)
;
/* Sector offset in the cluster */
ff.c:4078
f_write()
if
(
fp
->
fptr
==
0
)
{
/* On the top of the file? */
ff.c:4080
f_write()
fp
->
fptr
<
fp
->
obj
.
objsize
&&
ff.c:4141
f_write()
wcnt
=
SS
(
fs
)
-
(
UINT
)
fp
->
fptr
%
SS
(
fs
)
;
/* Number of bytes remains in the sector */
ff.c:4148
f_write()
memcpy
(
fp
->
buf
+
fp
->
fptr
%
SS
(
fs
)
,
wbuff
,
wcnt
)
;
/* Fit data to the sector */
ff.c:4155
f_write()
ifptr
=
fp
->
fptr
;
ff.c:4559
f_lseek()
fp
->
fptr
=
nsect
=
0
;
ff.c:4560
f_lseek()
fp
->
fptr
=
(
ifptr
-
1
)
&
~
(
FSIZE_t
)
(
bcs
-
1
)
;
/* start from the current cluster */
ff.c:4565
f_lseek()
ofs
-=
fp
->
fptr
;
ff.c:4566
f_lseek()
ofs
-=
bcs
;
fp
->
fptr
+=
bcs
;
ff.c:4582
f_lseek()
if
(
FF_FS_EXFAT
&&
fp
->
fptr
>
fp
->
obj
.
objsize
)
{
/* No FAT chain object needs correct objsize to generate FAT value */
ff.c:4585
f_lseek()
fp
->
obj
.
objsize
=
fp
->
fptr
;
ff.c:4586
f_lseek()
fp
->
fptr
+=
ofs
;
ff.c:4602
f_lseek()
if
(
!
FF_FS_READONLY
&&
fp
->
fptr
>
fp
->
obj
.
objsize
)
{
/* Set file change flag if the file size is extended */
ff.c:4610
f_lseek()
fp
->
obj
.
objsize
=
fp
->
fptr
;
ff.c:4611
f_lseek()
if
(
fp
->
fptr
%
SS
(
fs
)
&&
nsect
!=
fp
->
sect
)
{
/* Fill sector cache if needed */
ff.c:4614
f_lseek()
if
(
fp
->
fptr
<
fp
->
obj
.
objsize
)
{
/* Process when fptr is not on the eof */
ff.c:4966
f_truncate()
if
(
fp
->
fptr
==
0
)
{
/* When set file size to zero, remove entire cluster chain */
ff.c:4967
f_truncate()
fp
->
obj
.
objsize
=
fp
->
fptr
;
/* Set file size to current read/write point */
ff.c:4979
f_truncate()
const
off_t
prev_pos
=
f_tell
(
file
)
;
vfs_fat.c:504
vfs_fat_pread()
const
off_t
prev_pos
=
f_tell
(
file
)
;
vfs_fat.c:544
vfs_fat_pwrite()
off_t
cur_pos
=
f_tell
(
file
)
;
vfs_fat.c:639
vfs_fat_lseek()
FSIZE_t
seek_ptr_pos
=
(
FSIZE_t
)
f_tell
(
file
)
;
// current seek pointer position
vfs_fat.c:1161
vfs_fat_truncate()
if
(
res
!=
FR_OK
||
f_tell
(
file
)
!=
length
)
{
vfs_fat.c:1165
vfs_fat_truncate()
FSIZE_t
seek_ptr_pos
=
(
FSIZE_t
)
f_tell
(
file
)
;
// current seek pointer position
vfs_fat.c:1270
vfs_fat_ftruncate()
if
(
res
!=
FR_OK
||
f_tell
(
file
)
!=
length
)
{
vfs_fat.c:1274
vfs_fat_ftruncate()
fr
=
f_lseek
(
fp
,
f_tell
(
fp
)
+
step
)
;
/* Advances file pointer a cluster */
vfs_fat.c:1465
test_contiguous_file()
Call Tree
from
examples
All items filtered out
All items filtered out
Data Use
from
examples
FIL::fptr
is written by 4 functions and is read by 10 functions:
f_open()
f_read()
f_write()
f_lseek()
All items filtered out
FIL::fptr
f_read()
f_write()
f_lseek()
f_truncate()
vfs_fat_pread()
vfs_fat_pwrite()
vfs_fat_lseek()
vfs_fat_truncate()
vfs_fat_ftruncate()
test_contiguous_file()
All items filtered out
Class Tree
from
examples
All items filtered out
All items filtered out
Override Tree
from
examples
All items filtered out
All items filtered out
Implementations
from
examples
All items filtered out
All items filtered out
Instances
from
examples
Lifecycle
from
examples
All items filtered out
All items filtered out