<p>I am planning to create an agent that would run on Windows platform.</p>
<p>The agent should be able to monitor certain paths (folders and files / UNC paths). By "monitoring" i mean to save the metadata (size,modify time, owner, and perhaps the entire file and save it to a database over the network.</p>
<p>What would be the best way to achieve this ?</p>
<hr/>**评论:**<br/><br/>Decateron: <pre><p>Seems pretty straightforward. It looks like there's some support for <a href="https://github.com/fsnotify/fsnotify" rel="nofollow">file system notifications</a> in Go so you might be able to avoid polling for changes.</p></pre>suryon: <pre><p>Where do I keep the current state of things ? In memory in structs ? When do I discard the info ? after i save it immediately in DB ?</p></pre>zacheryph: <pre><p>YOU are doing this right? This is your project. Just start writing something. Little less planning. Little more coding. Let the pieces fall in place. Try things. Make mistakes.</p>
<p>A partially working prototype is a far better place to start than a "plan". You can plan all year and still not have a single clue what you are doing. Let me help. </p>
<p>package main</p></pre>AdmiralCornbread: <pre><p>This is very blunt...but I like it! If you have these questions, you need to get down and dirty and try a few things.</p>
<p>If this is a personal project, you'll learn a lot from trying different things. If it's for work, you'll be making a few throwaway prototypes if you can't quickly answer these questions.</p>
<p>This advice being useful depends on the size, scope, and use of the project (as well as how much you already know about the problem-space). The smaller the project, and the more unknowns, the more true this will ring.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传