This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Little cygpath improvement request
- From: Andrey Repin <anrdaemon at yandex dot ru>
- To: Corinna Vinschen <cygwin at cygwin dot com>
- Date: Sun, 16 Feb 2014 18:41:31 +0400
- Subject: Re: Little cygpath improvement request
- Authentication-results: sourceware.org; auth=none
- References: <111910987 dot 20140214222230 at mtu-net dot ru> <52FE6397 dot 5010105 at cygwin dot com> <187072112 dot 20140214234339 at mtu-net dot ru> <20140215125606 dot GM2246 at calimero dot vinschen dot de> <1745533059 dot 20140215225708 at mtu-net dot ru> <20140216120042 dot GP2246 at calimero dot vinschen dot de>
- Reply-to: cygwin at cygwin dot com
Greetings, Corinna Vinschen!
>> >> >> I would like to request a small functional change for cygpath.
>> >> >> In the event of empty given path argument (i.e. `cygpath -ml ""') silently
>> >> >> return an empty result without error message.
>> >> >> This would greatly simplify wrapper scripts.
>> >>
>> >> > Why isn't redirecting the message to /dev/null not sufficient, something
>> >> > like this (bash syntax)?
>> >>
>> >> Because it'll require creating a redirection? And this kind of redundant
>> >> inserts blurring the code.
>> >> Returning a non-zero exit code would suffice for debugging purposes.
>> >>
>> >> > cygpath -ml "" >/dev/null 2&>1
>> >>
>> >> Err, not > /dev/null !!! :D
>>
>> > dos_path=$( [ -n "${posix_path}" ] && cygpath -ml "${posix_path}" )
>>
>> > ?
>>
>> I appreciate the effort, bit this even MORE complicating the possible use
>> case.
>>
>> Look, I'm asking for simplification without loosing functionality.
>> If I NEED to check the path for existence, I would write something to the
>> extent of
> I'm getting a bit puzzled. If it's only the message you don't want,
> then why not just send this message to /dev/null???
Because the message serves no purpose in every use case I could think about.
That, aside the fact it needs to create a redirection.
> NATIVE=$(cygpath -ml "$2" 2>/dev/null)
>> But if I (and the program that I would feed it to) don't care (which is often
>> the case), the message printed from cygpath doesn't add to functionality.
>>
>> P.S.
>> I've tried to rebuild it myself, but hit a roadblock.
>> While trying to rebuild only winsup/utils, this happens
> That never works. Why don't you just fetch the source archive from
> the last package and use the cygport file inside?
Because I'm building Cygwin itself the first time. When my attempt at saving
time in hope it would "just work" failed, I followed FAQ to the letter, but
got nowhere either. The list of required packages to compile it seems to be
right, though. I've eventually succeed.
--
WBR,
Andrey Repin (anrdaemon@yandex.ru) 16.02.2014, <17:33>
Sorry for my terrible english...
--
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