Difference between revisions of "DPS909 & OSD600 Winter 2019"
(→Week 2) |
|||
Line 81: | Line 81: | ||
* Open Source and Code Reading | * Open Source and Code Reading | ||
− | ** | + | ** truncate |
+ | *** <code>echo "data" > file</code> | ||
+ | *** <code>> file</code> | ||
** <code>fs.truncate()</code> | ** <code>fs.truncate()</code> | ||
− | *** [https://github.com/nodejs/node/blob/ | + | *** [https://nodejs.org/api/fs.html#fs_fs_truncate_path_len_callback docs] |
− | *** [https://github.com/ | + | *** [https://github.com/nodejs/node/blob/6b7b8276d196ea5a0e6dcee4e63c548b7938e8f4/lib/fs.js#L618 JS src] |
− | *** [https:// | + | *** [http://docs.libuv.org/en/v1.x/fs.html?highlight=truncate#c.uv_fs_ftruncate libuv docs] |
− | *** [https://github.com/filerjs/filer/blob/master/src/filesystem/implementation.js# | + | *** [https://github.com/nodejs/node/blob/8a86d9c1cf35fe4f892d483e3673083f5d8f42cf/deps/uv/src/unix/fs.c#L1229 POSIX C src] |
− | ** | + | **** Uses [http://man7.org/linux/man-pages/man2/truncate.2.html ftruncate() system call] |
+ | *** [https://github.com/nodejs/node/blob/8a86d9c1cf35fe4f892d483e3673083f5d8f42cf/deps/uv/src/win/fs.c#L2318 Windows C src] | ||
+ | **** Uses [https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/content/ntifs/nf-ntifs-ntsetinformationfile NtSetInformationFile() system call] | ||
+ | *** [https://github.com/filerjs/filer/blob/master/src/filesystem/implementation.js#L2375 Filer source for truncate] | ||
+ | ** A great blog doing something similar: [https://blog.safia.rocks/post/169466425525/node-module-deep-dive-fs Deep Dive on the node fs module and fs.access()] by [https://blog.safia.rocks/ Safia Abdalla] | ||
* [[DPS909/OSD600 Winter 2019 Lab 1|Lab 1]] | * [[DPS909/OSD600 Winter 2019 Lab 1|Lab 1]] |
Revision as of 12:36, 18 January 2019
Week 1
- Releases
- 4 releases, some with multiple bugs/PRs required
- Chance to work on real code, real projects
- Big learning curve, lots of time required
- Amazing chance to gain experience, network, build your skills and resume
- Discussion/Readings
- Copyright (Copyright in Canada video)
- https://twitter.com/stan_sdcollins/status/1079395470731030528
- IANAL
- Who created it, "owns" it.
- Set of exclusive rights granted to the work's creator
- "The right to copy," to produce or reproduce a work or substantial portion thereof
- Copyright is automatic when a work is created, you don't have to register it.
- Copyright in Canada
- Copyright Guide
- In a software project, there can be many copyright holders (e.g., many contributors), or all contributors may assign their copyright to the project (e.g., CLA, which we'll cover later)
- Copyright (Copyright in Canada video)
- What is Open Source?
- First open technologies and projects we'll be using:
Week 2
- Release 0.1 Overview
- Due Wed Jan 30th
- node fs module vs. filer
- Licenses
- Rights, privileges, responsibilities, etc. applicable to someone other than the work's creator
- "Terms and Conditions"
- These must be granted by a copyright holder
- No License
- What can you do with code you find that has no license?
- what can I, can't I do?
- Public Domain
- SQLite, which is now used by literally everybody, see http://www.sqlite.org/famous.html
- Unlicense
- BSD License
- Family of Licenses, including 2-Clause BSD, 3-Clause BSD (aka New BDS), 4-Clause BSD
- "Why you should use a BSD style license for your Open Source Project"
- BSD Licenses code is usually compatible with other open/closed code, when you want to mix them.
- Example software projects licensed under the BSD License:
- Summary:
- You need to retain the license and copyright notice
- You can use it commercially or non-commercially (privately)
- You can distribute it freely
- You can modify it freely
- Open Source and Code Reading
- truncate
-
echo "data" > file
-
> file
-
-
fs.truncate()
- A great blog doing something similar: Deep Dive on the node fs module and fs.access() by Safia Abdalla
- truncate