Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
9657fc14
Commit
9657fc14
authored
1 year ago
by
Rye Mutt
Browse files
Options
Downloads
Patches
Plain Diff
Fox
parent
e398c547
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/llfilesystem/llfilesystem.cpp
+15
-12
15 additions, 12 deletions
indra/llfilesystem/llfilesystem.cpp
with
15 additions
and
12 deletions
indra/llfilesystem/llfilesystem.cpp
+
15
−
12
View file @
9657fc14
...
@@ -41,6 +41,12 @@ const S32 LLFileSystem::APPEND = 0x00000006; // 0x00000004 & LLFileSystem:
...
@@ -41,6 +41,12 @@ const S32 LLFileSystem::APPEND = 0x00000006; // 0x00000004 & LLFileSystem:
LLFileSystem
::
LLFileSystem
(
const
LLUUID
&
file_id
,
const
LLAssetType
::
EType
file_type
,
S32
mode
)
LLFileSystem
::
LLFileSystem
(
const
LLUUID
&
file_id
,
const
LLAssetType
::
EType
file_type
,
S32
mode
)
{
{
// build the filename (TODO: we do this in a few places - perhaps we should factor into a single function)
#if LL_WINDOWS
mFilePath
=
ll_convert_string_to_wide
(
LLDiskCache
::
metaDataToFilepath
(
file_id
,
file_type
));
#else
mFilePath
=
LLDiskCache
::
metaDataToFilepath
(
file_id
,
file_type
);
#endif
mFileType
=
file_type
;
mFileType
=
file_type
;
mFileID
=
file_id
;
mFileID
=
file_id
;
mPosition
=
0
;
mPosition
=
0
;
...
@@ -52,13 +58,6 @@ LLFileSystem::LLFileSystem(const LLUUID& file_id, const LLAssetType::EType file_
...
@@ -52,13 +58,6 @@ LLFileSystem::LLFileSystem(const LLUUID& file_id, const LLAssetType::EType file_
// we decided to follow Henri's suggestion and move the code to update the last access time here.
// we decided to follow Henri's suggestion and move the code to update the last access time here.
if
(
mode
==
LLFileSystem
::
READ
)
if
(
mode
==
LLFileSystem
::
READ
)
{
{
// build the filename (TODO: we do this in a few places - perhaps we should factor into a single function)
#if LL_WINDOWS
mFilePath
=
ll_convert_string_to_wide
(
LLDiskCache
::
metaDataToFilepath
(
file_id
,
file_type
));
#else
mFilePath
=
LLDiskCache
::
metaDataToFilepath
(
file_id
,
file_type
);
#endif
// update the last access time for the file if it exists - this is required
// update the last access time for the file if it exists - this is required
// even though we are reading and not writing because this is the
// even though we are reading and not writing because this is the
// way the cache works - it relies on a valid "last accessed time" for
// way the cache works - it relies on a valid "last accessed time" for
...
@@ -175,8 +174,6 @@ BOOL LLFileSystem::eof()
...
@@ -175,8 +174,6 @@ BOOL LLFileSystem::eof()
BOOL
LLFileSystem
::
write
(
const
U8
*
buffer
,
S32
bytes
)
BOOL
LLFileSystem
::
write
(
const
U8
*
buffer
,
S32
bytes
)
{
{
const
std
::
string
filename
=
LLDiskCache
::
metaDataToFilepath
(
mFileID
,
mFileType
);
BOOL
success
=
FALSE
;
BOOL
success
=
FALSE
;
if
(
mMode
==
APPEND
)
if
(
mMode
==
APPEND
)
...
@@ -268,7 +265,13 @@ S32 LLFileSystem::tell() const
...
@@ -268,7 +265,13 @@ S32 LLFileSystem::tell() const
S32
LLFileSystem
::
getSize
()
S32
LLFileSystem
::
getSize
()
{
{
return
LLFileSystem
::
getFileSize
(
mFileID
,
mFileType
);
boost
::
system
::
error_code
ec
;
S32
file_size
=
boost
::
filesystem
::
file_size
(
mFilePath
,
ec
);
if
(
ec
.
failed
())
{
return
0
;
}
return
file_size
;
}
}
S32
LLFileSystem
::
getMaxSize
()
S32
LLFileSystem
::
getMaxSize
()
...
@@ -294,7 +297,7 @@ BOOL LLFileSystem::rename(const LLUUID& new_id, const LLAssetType::EType new_typ
...
@@ -294,7 +297,7 @@ BOOL LLFileSystem::rename(const LLUUID& new_id, const LLAssetType::EType new_typ
BOOL
LLFileSystem
::
remove
()
BOOL
LLFileSystem
::
remove
()
{
{
LLFileSystem
::
removeFile
(
mFileID
,
mFileType
)
;
boost
::
system
::
error_code
ec
;
boost
::
filesystem
::
remove
(
mFilePath
,
ec
);
return
TRUE
;
return
TRUE
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment