Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What does inPlace do? #67

Closed
kenchris opened this issue Jun 27, 2019 · 4 comments
Closed

What does inPlace do? #67

kenchris opened this issue Jun 27, 2019 · 4 comments
Milestone

Comments

@kenchris
Copy link

kenchris commented Jun 27, 2019

In response to w3ctag/design-reviews#390

Also, I find inPlace confusing. It doesn't explain what inPlace does, and repeats the description of keepExistingData's behavior. Our understanding so far is that inPlace = true means it will write directly to the destination file without creating a temporary copy first, but it's not clear. So potentially faster, but I though the copy was there because of security and integrity - I understood you never wanted to write incomplete data.

@cynthia
Copy link

cynthia commented Jul 31, 2019

In particular, I'm curious whether or not inPlace would give some form of guarantee of exclusive access, since multiple tabs clobbering the same file seems like asking for trouble.

mkruisselbrink added a commit that referenced this issue Aug 26, 2019
Tries to make the difference between inPlace: true and false clearer,
mentions the implementation status for inPlace: true in Chrome, and
tries to make it clearer what is going on with keepExistingData.

Addresses #76 and #67
@mkruisselbrink mkruisselbrink added this to the V1 milestone Aug 26, 2019
mkruisselbrink added a commit that referenced this issue Aug 27, 2019
Tries to make the difference between inPlace: true and false clearer,
mentions the implementation status for inPlace: true in Chrome, and
tries to make it clearer what is going on with keepExistingData.

Addresses #76 and #67
mkruisselbrink added a commit that referenced this issue Aug 27, 2019
Tries to make the difference between inPlace: true and false clearer,
mentions the implementation status for inPlace: true in Chrome, and
tries to make it clearer what is going on with keepExistingData.

Addresses #76 and #67
@mkruisselbrink
Copy link
Contributor

I tried to make it bit clearer what inPlace is supposed to be in the documentation for createWriter. Although to be honest I'm not quite sure yet what inPlace=true is going to be like. It seems like we'll want to provide something like that, but it is rather unclear at this point how we will do that while not making it less secure. Because of that the current description of inPlace=true is kind of hand-wavy not really giving any guarantees (and rather giving a lack of guarantees), which makes the difference between it and inPlace=false less clear.

@foolip
Copy link
Member

foolip commented Nov 20, 2019

inPlace was removed in commit 5e1146e.

@pizzapanther
Copy link

I'm writing a text editor and notice the current implementation in Chrome breaks file watch processes. Since the file is replaced and not updated in place, the file watcher catches the first edit but not subsequent edits. This throws a wrench in development processes which watch files and automatically recompile. Here are example events I caught with inotify.

$ python3 -m pyinotify narf.txt
<Event dir=False mask=0x4 maskname=IN_ATTRIB name='' path=narf.txt pathname=/home/paul/tmp/narf.txt wd=1 >
<Event dir=False mask=0x400 maskname=IN_DELETE_SELF name='' path=narf.txt pathname=/home/paul/tmp/narf.txt wd=1 >
<Event dir=False mask=0x8000 maskname=IN_IGNORED name='' path=narf.txt pathname=/home/paul/tmp/narf.txt wd=1 >

Those are the events after the first edit. Edits after the first edit do not show up in the file watch. I think what is happening is the file is watched by file ID and not by path. Thus when the original file is deleted IN_DELETE_SELF the file watcher loses track of edits.

Since this method of editing files is not typical, it would be great to have an option to edit in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants