Comments (3)
Thanks for your bug report. I don't see anything wrong here: if I run posix.readlink on a symlink, it returns the link; otherwise, it returns an error. Hence, I am guessing that in this case /tmp is not a symlink. Have you read readlink(2)?
from luaposix.
Sorry. I think "readlink(path)" should return the absolute path.
from luaposix.
posix.readlink should do what the POSIX function readlink does. As far as I can tell, it does this. As the man page says: "readlink() places the contents of the symbolic link path in the buffer buf". The only difference is that posix.readlink returns a string, as you don't have to worry about buffers in Lua. If the link is relative, then a relative path will be returned. If you want an absolute path, then at the moment you're out of luck, as you need "realpath", which is not currrently in luaposix. I'd be happy to accept a patch to add it.
from luaposix.
Related Issues (20)
- strftime: garbage from %z, garbage and segfaults from %Z HOT 10
- posix.sys.resource: rlim_t values may overflow integers HOT 1
- `readlink` doesnโt work on `/proc/self/fd` magiclinks HOT 1
- Incorrect fork error-handling HOT 2
- luke: fatal: required symbol 'crypt' not found in any of libc, libcrypt HOT 5
- Using unix sockets in a non-blocking manner / timeouts HOT 2
- Small error in doc for poll(): return is not 0/1 but the number of ready fd's
- pwd.getpwuid fails with 0.0 as input HOT 3
- posix.fcntl is a function, not a table. HOT 15
- luxposix 36.0 won't compile properly on CentOS7 - time.h issues HOT 14
- posix.sys.socket - recv() crashes with socket and timeout in v36.1 (v36.0) HOT 6
- Lazy loading of posix.sys.stat fails in both 35.1 and 36.1 HOT 6
- luaposix won't compile in termux HOT 26
- Missing rockspec file in v36.1 HOT 7
- Get an error when trying to cross-compile HOT 1
- String overflow for unistd.read(). HOT 6
- Epoch inconsistency?
- Error on import: posix/glob.so: wrong ELF class: ELFCLASS64 HOT 7
- invalid elf header HOT 1
- luaposix does not cross compile properly HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from luaposix.