如何在目录甚至子目录中找到所有零字节文件?
我这样做了:
#!/bin/bash
lns=`vdir -R *.* $dir| awk '{print $8"\t"$5}'`
temp=""
for file in $lns
do
if test $file = "0"
then
printf $temp"\t"$file"\n"
fi
temp=$file
done
Run Code Online (Sandbox Code Playgroud)
但我只得到该目录文件中的结果而不是所有文件,如果任何文件名有空格,那么我只得到第一个单词后跟tab
谁能帮我?
我在生产中遇到此错误。不知道到底是什么原因造成的。
OnSubscriptionError :
Microsoft.Exchange.WebServices.Data.ServiceResponseException:
The specified subscription was not found.
Run Code Online (Sandbox Code Playgroud)
现在我想在我的开发环境中模拟行为。
我已经订阅了event Connection.OnSubscriptionError,我的事件处理程序是OnSubscriptionError。现在我要测试处理程序。为此,我想要某种触发事件的方式,我很难解决。
我已尝试在应用程序运行时关闭Exchange主机服务,但这并不会启动OnsubscriptionError Event。
我想知道以下代码在OnsubscriptionError event被触发时是否有效。还是在创建连接之前必须重新创建Subscription对象。
这是示例代码:
Subscription =_exchangeService.SubscribeToStreamingNotifications(
new FolderId[] { WellKnownFolderName.Inbox },
EventType.NewMail);
CreateStreamingSubscription(_exchangeService, Subscription);
private void CreateStreamingSubscription(ExchangeService service,
StreamingSubscription subscription)
{
// public StreamingSubscriptionConnection(ExchangeService service, int lifetime) lifetime is in minutes and 30 mins is the maximum time till which
// the connection can be open.
Connection = new StreamingSubscriptionConnection(service, 30);
Connection.AddSubscription(subscription);
Connection.OnNotificationEvent += OnNotificationEvent;
Connection.OnSubscriptionError += …Run Code Online (Sandbox Code Playgroud) 我正在使用带有此代码的.net 2010 c#windows应用程序:检查有效Uri与否
码:
static bool IsValidUrl(string urlString)
{
Uri uri;
return Uri.TryCreate(urlString, UriKind.Absolute, out uri)
&& (uri.Scheme == Uri.UriSchemeHttp
|| uri.Scheme == Uri.UriSchemeHttps
|| uri.Scheme == Uri.UriSchemeFtp
|| uri.Scheme == Uri.UriSchemeMailto
);
}
Run Code Online (Sandbox Code Playgroud)
问题:如果我验证这个http://http://www.Google.com我得到它的有效但当我尝试使用IE时它没有显示任何网站.
有没有办法找出String是否有效uri?(没有使用正则表达式和互联网访问)
当我使用pattren
"(see|see also) [\w\d]+"
Run Code Online (Sandbox Code Playgroud)
在文字上
see page
see also page
Run Code Online (Sandbox Code Playgroud)
但输出匹配是
see page
see also
Run Code Online (Sandbox Code Playgroud)
如果我互换了,请参阅
"(see also|see) [\w\d]+"
Run Code Online (Sandbox Code Playgroud)
输出是
see page
see also page
Run Code Online (Sandbox Code Playgroud)
我以为两者都是一样的.我可以知道为什么会这样吗?