You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
-
2Not meant to work on pipes doesnt mean cant work on pipes. What if the application is simply doing a SEEK_END to get to the end of the file? Or maybe its doing a SEEK_CUR to find the current location. Neither of these would cause any issues if I lied to the program about the results of the seek. The only place that would break is if the application was trying to go back and overwrite data already written which it shouldnt be doing with log files. And yes, I am aware of the one-process-per-pipe limitation. This will not be a problem.phemmer– phemmer2012-02-05 23:17:28 +00:00Commented Feb 5, 2012 at 23:17
-
1If all it does is seek to the end to append, then it should just be opening the file in append mode, so it falls into the broken category. Applications don't try to find the current location unless they need to be able to seek somewhere else, and then return to the current location, so it falls into the "you'll break it by silently failing" category. It is very unlikely that a program calls seek but doesn't really need it to work ( and if it does, it falls in the broken category ).psusi– psusi2012-02-06 04:08:37 +00:00Commented Feb 6, 2012 at 4:08
-
1Not true. Many applications seek to the end of the file in case some other program has written to the file since it last did. Otherwise writing where its currently at would clobber the other program's changes. And if its reading from the file, it might want to use SEEK_CUR to get its current location so that when the program starts back up, it can resume where it left off.phemmer– phemmer2012-02-06 05:00:13 +00:00Commented Feb 6, 2012 at 5:00
-
1@Patrick, for the former, if it is appending it should be reopening the file in append mode. In this case you are talking about reading, in which case, it doesn't make sense to skip new data it hasn't read yet ( and silently ignoring the seek would break that ). As for the latter, if it is trying to use seek to return to the same position after closing and reopening the file that will break on a pipe if you silently ignore the seek, since when it closes the pipe the server gets a SIGPIPE, which presumably makes it reset so the next client that opens the pipe starts at the beginning.psusi– psusi2012-02-06 23:47:02 +00:00Commented Feb 6, 2012 at 23:47
Add a comment
|
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
-
create code fences with backticks ` or tildes ~
```
like so
``` -
add language identifier to highlight code
```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible)
<https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. shell-script), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you