Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
b798580f
Commit
b798580f
authored
Nov 11, 2014
by
funshine
Browse files
6 channel pwm, add file.seek()
parent
ffd2e9c3
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
0.9.2/512k-flash/eagle.app.v6.flash.bin
View file @
b798580f
No preview for this file type
0.9.2/512k-flash/eagle.app.v6.irom0text.bin
View file @
b798580f
No preview for this file type
README.html
View file @
b798580f
This diff is collapsed.
Click to expand it.
README.md
View file @
b798580f
...
@@ -2,6 +2,10 @@
...
@@ -2,6 +2,10 @@
###version 0.2 2014-11-10
###version 0.2 2014-11-10
###change log:
###change log:
2014-11-11
<br
/>
add file.seek() api to file module
<br
/>
now max 6 pwm channel is supported
<br
/>
2014-11-10
<br
/>
2014-11-10
<br
/>
change log module to file module
<br
/>
change log module to file module
<br
/>
now file operation support multiple read/write
<br
/>
now file operation support multiple read/write
<br
/>
...
@@ -411,6 +415,42 @@ nil
...
@@ -411,6 +415,42 @@ nil
**-**
[
file.open()
](
#fl_open
)
<br
/>
**-**
[
file.open()
](
#fl_open
)
<br
/>
**-**
[
file.writeline()
](
#fl_writeline
)
**-**
[
file.writeline()
](
#fl_writeline
)
<a
id=
"fl_seek"
></a>
## file.seek()
####Description
Sets and gets the file position, measured from the beginning of the file, to the position given by offset plus a base specified by the string whence.
####Syntax
file.seek(whence, offset)
####Parameters
whence:
<br
/>
"set": base is position 0 (beginning of the file);
<br
/>
"cur": base is current position;(default value)
<br
/>
"end": base is end of file;
<br
/>
offset: default 0
####Returns
success: returns the final file position
<br
/>
fail: returns nil
####Example
```
-- open 'init.lua' in 'a+' mode
file.open("init.lua", "a+")
-- write 'foo bar' to the end of the file
file.write('foo bar')
file.flush()
file.seek("set")
print(file.readline())
file.close()
```
####See also
**-**
[
file.open()
](
#fl_open
)
<br
/>
**-**
[
file.writeline()
](
#fl_writeline
)
<a
id=
"fl_list"
></a>
<a
id=
"fl_list"
></a>
## file.list()
## file.list()
####Description
####Description
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment