Comments (10)
I will start with this.
from coreutils.
Nice, have fun 😄
from coreutils.
@GrayJack i ran into a problem here. Maybe you know how to solve it. cp -p -R symlink
should copy a symlink and preserve its metadata. But apparently there is no way in Rust to copy a symlink. You can only create one. But also you can not set a file's metadata, at least i could not find any way to do so. Do you have an idea?
from coreutils.
I have to look into that, never done it
from coreutils.
How do you preserve the metadata on the other types of file?
from coreutils.
fs::copy()
copies a file with metadata. And to not preserve it i use io::copy()
. For dir
s i have the same problem as with symlinks. There is a function in fs
to set permissions but i found nothing about modified, creation date etc.
from coreutils.
Did you found out any more info on how to do this?
from coreutils.
Aha!!! Found it, to preserve attributes of a link you have to hardlink the files
So, if you want to copy a symlink, you have to hardlink the link to another path, and hardlink will preserve the attributes
fs::hard_link()
function does that
from coreutils.
Yes, but a hardlink is not a symlink if i understood correctly.
from coreutils.
Yes, but all code that I saw (FreeBSD, NetBSD and uutils) does that when preserving a copy a symlink preserving metadata
from coreutils.
Related Issues (20)
- [BUG] error message format and exist code is not clear HOT 5
- csplit: implement --suppress-matched
- csplit: add option `--elide-empty-files`
- csplit: support option `--suffix-format`
- Touch: Make -d accept more complex date format
- Touch: Implement -t option
- Man pages HOT 1
- Head: support - input HOT 2
- Uniq: Implement -f option HOT 6
- Seq: Implement -f option
- Seq: Missing last number on some cases HOT 3
- Seq : Missing last output on some cases
- Seq: Does not output when FIRST and LAST are the same number
- Seq: parsing arguments not working
- [BUG] `UtmpxSet::system()` shows killed sessions the same as active sessions HOT 13
- Implement shutdown HOT 4
- Packaging support HOT 5
- [BUG] Rmdir: error when -Ip on legit cases HOT 2
- Date: Implement settimeofday HOT 13
- Date: Implement correct parsing of input date HOT 2
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 coreutils.