This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Symlink file size
- From: Steven Penny <svnpenn at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Tue, 07 Mar 2017 19:37:21 -0800 (PST)
- Subject: Symlink file size
- Authentication-results: sourceware.org; auth=none
Cygwin seems to have no way to print an accurate size of a symlink. Consider
this command:
$ touch alfa.txt
$ CYGWIN= ln -s alfa.txt bravo.txt
Now cmd.exe can print the correct size just fine:
> dir /AS
2017-03-07 09:26 PM 30 bravo.txt
However Cygwin prints incorrect 8 bytes with ls:
$ ls -l
total 2
-rw-r--r-- 1 Steven None 0 Mar 7 21:26 alfa.txt
lrwxrwxrwx 1 Steven None 8 Mar 7 21:26 bravo.txt -> alfa.txt
and stat:
$ stat --format %s bravo.txt
8
and du:
$ du -b bravo.txt
8 bravo.txt
and find:
$ find bravo.txt -printf %s
8
wc seems to draw from the source file:
$ wc -c bravo.txt
0 bravo.txt
What gives?
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple