Comments (3)
Hey @schomatis ,i am doing for this bug now.But i want to know that what i should do when
if cur+bs <= offset
?
from go-unixfs.
I'm not really sure but I think we should replicate the logic from Seek
,
Lines 453 to 457 in 929f9a5
where, if the offset is bigger than the file length, we expand the file DAG; copying that logic into the Sync
function,
Lines 203 to 225 in 929f9a5
Before appending the data, and after modifyDag
has been called, we should check if writeStart
(the offset where we should start writing) is bigger the the file size, and in that case (as before) also expand the file before appending.
Right now if you have to write to the offset 4 in a file of length 0 modifyDag
will do nothing (which is correct, there is no existing space to overwrite) and Sync
will just append the write buffer to the end of the file, that in this case would be the offset 0 (since that's the end of the file) which is incorrect, we want to fill the file DAG with zeros between the end of the DAG (offset 0) and the place to start writing (offset 4) and only then append the write data.
You'll need to check this patch against the go-ipfs
tests, that means using gx-go link
to make go-ipfs
use your modified go-unixfs
and not the Gx version.
from go-unixfs.
Fixed by #33.
from go-unixfs.
Related Issues (20)
- Do not add an internal timeout for "extra" fetches used to compute directory size in the unsharding algorithm HOT 4
- [unsharding] Follow up on some low-priority fixes/renames/refactors HOT 1
- The context in `CtxReadFull` is not propagated to the child nodes being read HOT 4
- Trying to use in project, fails with go-merkledag errors HOT 2
- Avoid use of `pb.Data` HOT 6
- Use only one kind of variable to refer to data types HOT 1
- Importers: DAGService should not be batched internally by default HOT 5
- Remove the `child` interface from the `hamt` package HOT 6
- Maybe we could use `ResolveLink` HOT 1
- Remove the internal `ProtoNode` from the `Shard` structure HOT 19
- HAMT: evaluate using the DAG walker in `getValue` HOT 3
- HAMT: review `getValue` and `walkTrie` HOT 1
- `go-merkledag` dependency version discrepancy with `go-ipfs` HOT 9
- Can we remove the `expandSparse` call in `WriteAt`? HOT 5
- "Impedance mismatch" between mode as specified in spec/UNIXFS.md and go's os.FileMode HOT 7
- Add created/modified fields to unixfs files HOT 2
- State of UnixFS v2 HOT 3
- Plan a transition of unixfs to go-ipld-prime HOT 7
- Remove `HAMTShard` UnixFS type HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-unixfs.