FatFS
FIL::obj
is only used within FatFS.
Symbol previews are coming soon...
Symbols
loading (3/5)...
Files
loading (4/5)...
Summary
Syntax
Examples
References
Call Tree
Data Use
Class Tree
Override Tree
Implementations
Instances
Lifecycle
SourceVu
ESP-IDF Framework and Examples
FatFS
FIL::obj
FIL::obj field
Syntax
Show:
Summary
Declaration
from
ff.h:208
FFOBJID
obj
;
Examples
References
from
examples
Code
Location
Referrer
FFOBJID
obj
;
/* Object identifier (must be the 1st member to detect invalid object pointer) */
ff.h:208
fp
->
obj
.
sclust
=
ld_clust
(
fs
,
dj
.
dir
)
;
/* Get object allocation info */
ff.c:3868
f_open()
fp
->
obj
.
objsize
=
ld_dword
(
dj
.
dir
+
DIR_FileSize
)
;
ff.c:3869
f_open()
fp
->
obj
.
fs
=
fs
;
/* Validate the file object */
ff.c:3874
f_open()
fp
->
obj
.
id
=
fs
->
id
;
ff.c:3875
f_open()
if
(
(
mode
&
FA_SEEKEND
)
&&
fp
->
obj
.
objsize
>
0
)
{
/* Seek to end of file if FA_OPEN_APPEND is specified */
ff.c:3896
f_open()
fp
->
fptr
=
fp
->
obj
.
objsize
;
/* Offset to seek */
ff.c:3897
f_open()
clst
=
fp
->
obj
.
sclust
;
/* Follow the cluster chain */
ff.c:3899
f_open()
for
(
ofs
=
fp
->
obj
.
objsize
;
res
==
FR_OK
&&
ofs
>
bcs
;
ofs
-=
bcs
)
{
ff.c:3900
f_open()
clst
=
get_fat
(
&
fp
->
obj
,
clst
)
;
ff.c:3901
f_open()
fp
->
obj
.
fs
=
0
;
/* Invalidate file object on error */
ff.c:3928
f_open()
res
=
validate
(
&
fp
->
obj
,
&
fs
)
;
/* Check validity of the file object */
ff.c:3968
f_read()
remain
=
fp
->
obj
.
objsize
-
fp
->
fptr
;
ff.c:3971
f_read()
clst
=
fp
->
obj
.
sclust
;
/* Follow cluster chain from the origin */
ff.c:3979
f_read()
clst
=
get_fat
(
&
fp
->
obj
,
fp
->
clust
)
;
/* Follow cluster chain on the FAT */
ff.c:3987
f_read()
res
=
validate
(
&
fp
->
obj
,
&
fs
)
;
/* Check validity of the file object */
ff.c:4067
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()
clst
=
fp
->
obj
.
sclust
;
/* Follow from the origin */
ff.c:4081
f_write()
clst
=
create_chain
(
&
fp
->
obj
,
0
)
;
/* create a new cluster chain */
ff.c:4083
f_write()
clst
=
create_chain
(
&
fp
->
obj
,
fp
->
clust
)
;
/* Follow or stretch cluster chain on the FAT */
ff.c:4092
f_write()
if
(
fp
->
obj
.
sclust
==
0
)
fp
->
obj
.
sclust
=
clst
;
/* Set start cluster if the first write */
ff.c:4099
f_write()
fp
->
fptr
<
fp
->
obj
.
objsize
&&
ff.c:4141
f_write()
res
=
validate
(
&
fp
->
obj
,
&
fs
)
;
/* Check validity of the file object */
ff.c:4182
f_sync()
st_clust
(
fp
->
obj
.
fs
,
dir
,
fp
->
obj
.
sclust
)
;
/* Update file allocation information */
ff.c:4229
f_sync()
st_dword
(
dir
+
DIR_FileSize
,
(
DWORD
)
fp
->
obj
.
objsize
)
;
/* Update file size */
ff.c:4230
f_sync()
res
=
validate
(
&
fp
->
obj
,
&
fs
)
;
/* Lock volume */
ff.c:4265
f_close()
fp
->
obj
.
fs
=
0
;
/* Invalidate file object */
ff.c:4271
f_close()
res
=
validate
(
&
fp
->
obj
,
&
fs
)
;
/* Check validity of the file object */
ff.c:4490
f_lseek()
if
(
ofs
>
fp
->
obj
.
objsize
&&
(
FF_FS_READONLY
||
!
(
fp
->
flag
&
FA_WRITE
)
)
)
{
/* In read-only mode, clip offset with the file size */
ff.c:4556
f_lseek()
ofs
=
fp
->
obj
.
objsize
;
ff.c:4557
f_lseek()
clst
=
fp
->
obj
.
sclust
;
/* start from the first cluster */
ff.c:4569
f_lseek()
clst
=
create_chain
(
&
fp
->
obj
,
0
)
;
ff.c:4572
f_lseek()
fp
->
obj
.
sclust
=
clst
;
ff.c:4575
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()
clst
=
create_chain
(
&
fp
->
obj
,
clst
)
;
/* Follow chain with forceed stretch */
ff.c:4589
f_lseek()
clst
=
get_fat
(
&
fp
->
obj
,
clst
)
;
/* Follow cluster chain if not in write mode */
ff.c:4596
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()
res
=
validate
(
&
fp
->
obj
,
&
fs
)
;
/* Check validity of the file object */
ff.c:4962
f_truncate()
if
(
fp
->
fptr
<
fp
->
obj
.
objsize
)
{
/* Process when fptr is not on the eof */
ff.c:4966
f_truncate()
res
=
remove_chain
(
&
fp
->
obj
,
fp
->
obj
.
sclust
,
0
)
;
ff.c:4968
f_truncate()
fp
->
obj
.
sclust
=
0
;
ff.c:4969
f_truncate()
ncl
=
get_fat
(
&
fp
->
obj
,
fp
->
clust
)
;
ff.c:4971
f_truncate()
res
=
remove_chain
(
&
fp
->
obj
,
ncl
,
fp
->
clust
)
;
ff.c:4976
f_truncate()
fp
->
obj
.
objsize
=
fp
->
fptr
;
/* Set file size to current read/write point */
ff.c:4979
f_truncate()
res
=
validate
(
&
fp
->
obj
,
&
fs
)
;
/* Check validity of the file object */
ff.c:5617
f_expand()
if
(
fsz
==
0
||
fp
->
obj
.
objsize
!=
0
||
!
(
fp
->
flag
&
FA_WRITE
)
)
LEAVE_FF
(
fs
,
FR_DENIED
)
;
ff.c:5619
f_expand()
n
=
get_fat
(
&
fp
->
obj
,
clst
)
;
ff.c:5646
f_expand()
fp
->
obj
.
sclust
=
scl
;
/* Update object allocation information */
ff.c:5679
f_expand()
fp
->
obj
.
objsize
=
fsz
;
ff.c:5680
f_expand()
if
(
FF_FS_EXFAT
)
fp
->
obj
.
stat
=
2
;
/* Set status 'contiguous chain' */
ff.c:5681
f_expand()
if
(
fat_ctx
->
files
[
i
]
.
obj
.
fs
==
NULL
)
{
vfs_fat.c:288
get_next_fd()
if
(
(
res
=
f_lseek
(
file
,
f_size
(
file
)
)
)
!=
FR_OK
)
{
vfs_fat.c:444
vfs_fat_write()
off_t
size
=
f_size
(
file
)
;
vfs_fat.c:642
vfs_fat_lseek()
ESP_LOGD
(
TAG
,
"%s: offset=%ld, filesize:=%"
PRIu32
,
__func__
,
new_pos
,
f_size
(
file
)
)
;
vfs_fat.c:652
vfs_fat_lseek()
st
->
st_size
=
f_size
(
file
)
;
vfs_fat.c:668
vfs_fat_fstat()
size_t
size_left
=
f_size
(
pf1
)
;
vfs_fat.c:824
vfs_fat_link()
FSIZE_t
sz
=
(
FSIZE_t
)
f_size
(
file
)
;
// current file size (end of file position)
vfs_fat.c:1162
vfs_fat_truncate()
FSIZE_t
sz
=
(
FSIZE_t
)
f_size
(
file
)
;
// current file size (end of file position)
vfs_fat.c:1271
vfs_fat_ftruncate()
clsz
=
(
DWORD
)
fp
->
obj
.
fs
->
csize
*
fp
->
obj
.
fs
->
ssize
;
vfs_fat.c:1458
test_contiguous_file()
fsz
=
f_size
(
fp
)
;
vfs_fat.c:1460
test_contiguous_file()
clst
=
fp
->
obj
.
sclust
-
1
;
/* A cluster leading the first cluster for first test */
vfs_fat.c:1462
test_contiguous_file()
Call Tree
from
examples
All items filtered out
All items filtered out
Data Use
from
examples
FIL::obj
is read by 16 functions:
All items filtered out
FIL::obj
f_open()
f_read()
f_write()
f_sync()
f_close()
f_lseek()
f_truncate()
f_expand()
get_next_fd()
vfs_fat_write()
vfs_fat_lseek()
vfs_fat_fstat()
vfs_fat_link()
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