我正在读取一个文件,我要么读取一行数据(1600个连续读取17个字节)或一列数据(1600个读取17个字节,由1600*17 = 27,200个字节分隔).该文件位于本地驱动器或远程驱动器上.我做了10次读取,所以我希望在每种情况下读取272,000字节的数据.
在当地的车道上,我看到了我的期望.在按顺序阅读的远程驱动器上,我也看到了我的期望,但在读取列时,我看到正在进行大量的额外读取.它们长度为32,768字节,似乎没有使用,但它们使读取的数据量从272,000字节跳到79 MB到106 MB.以下是使用Process Monitor的输出:
1:39:39.4624488 PM DiskSpeedTest.exe 89628 ReadFile \\BCCDC01\BCC-raid3\SeisWareInc Temp Dir\BPepers_Temp\Projects\PT_4\Horizons\BaseName3D_1\RR_AP SUCCESS Offset: 9,390,069, Length: 17 1:39:39.4624639 PM DiskSpeedTest.exe 89628 FASTIO_CHECK_IF_POSSIBLE \\BCCDC01\BCC-raid3\SeisWareInc Temp Dir\BPepers_Temp\Projects\PT_4\Horizons\BaseName3D_1\RR_AP SUCCESS Operation: Read, Offset: 9,390,069, Length: 17 1:39:39.4624838 PM DiskSpeedTest.exe 89628 ReadFile \\BCCDC01\BCC-raid3\SeisWareInc Temp Dir\BPepers_Temp\Projects\PT_4\Horizons\BaseName3D_1\RR_AP SUCCESS Offset: 9,388,032, Length: 32,768, I/O Flags: Non-cached, Paging I/O, Synchronous Paging I/O, Priority: Normal 1:39:39.4633839 PM DiskSpeedTest.exe 89628 ReadFile \\BCCDC01\BCC-raid3\SeisWareInc Temp Dir\BPepers_Temp\Projects\PT_4\Horizons\BaseName3D_1\RR_AP SUCCESS Offset: 9,417,269, Length: 17 1:39:39.4634002 PM DiskSpeedTest.exe 89628 FASTIO_CHECK_IF_POSSIBLE \\BCCDC01\BCC-raid3\SeisWareInc Temp Dir\BPepers_Temp\Projects\PT_4\Horizons\BaseName3D_1\RR_AP SUCCESS …
有人可以帮我将文件从共享文件夹复制到本地驱动器吗?我的代码是:
import jcifs.smb.NtlmPasswordAuthentication;
import jcifs.smb.SmbFile;
import jcifs.smb.SmbFileInputStream;
import jcifs.smb.SmbFileOutputStream;;
public class smb {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
String urlToBackUpFile = "smb://ip/backup$/test.txt";
System.out.println("smb folder of source file" + urlToBackUpFile);
NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, "login", "pass");
SmbFile dir = new SmbFile(urlToBackUpFile, auth);
System.out.println(dir.getDate());
SmbFile dest = new SmbFile ("C:/SQLRESTORESTAGE/v2.bak");
dir.copyTo(dest);
}
}
Run Code Online (Sandbox Code Playgroud)
不复制文件文件.我收到一条消息"无法连接到服务器",但程序显示源文件的dir.getDate()(以及文件名和长度).所以我认为目标文件夹的问题(C:/ SQLRESTORESTAGE /).另外,我只能阅读源文件.你能帮我修改代码或建议吗?谢谢.
我刚刚安装了Ubuntu 12.10,我试图将文件夹挂载到Ubuntu系统.所以我用过:
sudo smbmount <folder> /path/to/my/folder -ouser=<my id>, dom=<my dom>
Run Code Online (Sandbox Code Playgroud)
但是没有找到smbmount ...我现在拥有的只是cifs-utils.
上面的命令适用于Ubuntu 12.04,但不适用于12.10.
任何提示?
Thx提前:)
在我重新安装Windows 10之前,我使用了使用SMB同步类型的Vagrant盒子(ubuntu/xenial64).现在,我以同样的方式(安装Virtual Box + Vagrant,两个最新版本),我更改了配置以使用SMB并设置mount_options.这是配置.我从cmd运行作为管理员(Powershell和简单的cmd,尝试过两者)vagrant up,但流浪汉仍然问我用户名和密码.那么,我该如何设置默认用户名和密码?在它为我工作之前.用户名和密码是正确的,因为当我在控制台中输入它时,它接受的成功和文件夹安装良好.
Windows 10 Pro x64 1703
Vagrant 1.9.5
VirtualBox 5.1.22
Box:ubuntu/xenial64
谢谢
我正在尝试在终端上安装 SMB 共享。如果使用以下命令服务器的名称中没有空格,我可以做到这一点:
$ mount -t smbfs //user:password@server/resource /Volumes/resource
Run Code Online (Sandbox Code Playgroud)
但是,在我的情况下,服务器名称有一个空格,我无法弄清楚如何正确传递这样的名称。
我尝试使用双引号或单引号:
$ mount -t smbfs "//user:password@ser ver/resource" /Volumes/resource
mount_smbfs: URL parsing failed, please correct the URL and try again: Invalid argument
Run Code Online (Sandbox Code Playgroud)
我尝试逃离空间:
$ mount -t smbfs //user:password@ser\ ver/resource /Volumes/resource
mount_smbfs: URL parsing failed, please correct the URL and try again: Invalid argument
Run Code Online (Sandbox Code Playgroud)
我也尝试使用%20, \x20and \040,但出现错误:
mount_smbfs: server connection failed: No route to host
Run Code Online (Sandbox Code Playgroud)
我知道我可以使用 IP 地址或重命名服务器,但这将是一种解决方法而不是解决方案,我想知道我错过了什么。
我有一个shell脚本,我用它来访问SMB客户端:
#!/bin/bash
cd /home/username
smbclient //link/to/server$ password -W domain -U username
recurse
prompt
mput baclupfiles
exit
Run Code Online (Sandbox Code Playgroud)
现在,脚本运行,访问服务器,然后要求手动输入命令.
可有人告诉我怎么去的命令recurse,prompt,mput baclupfiles并exit通过shell脚本运行的命令吗?
我想使用 React Native 连接到外部数据库,例如 PostgreSQL、MySQL 或其他数据库。这可能吗?
但首先让我告诉您一些有关我的计划的信息:我将为多个安装(多个设备 - 一台设备上的一个安装)开发我的应用程序。所有设备都与 Windows 安装(服务器)提供的本地网络连接。服务器上运行一个数据库(PostgreSQL),我想用我的所有设备连接到这个数据库。服务器(或者实际上是它的数据库)应该存储任务,并且每个设备应该在本地访问这些任务(读取和写入)。

我还有一些其他的想法,例如简单的 SMB-XML 文件存储(但存在冲突问题)和 SMB 共享文件上的 SQLite 数据库 - 但 SQLite 的网站告诉我们,这不会避免多次访问的问题。因此我需要另一个本地解决方案。这让我提供了一个可以从本地网络访问的数据库。
如果有人能说明如何解决这个问题,我将不胜感激。
谢谢你!
我们有一个应用程序,可以通过 Azure 文件列出文件夹中的文件。当我们使用C#方法时:
Directory.GetFiles(@"\\account.file.core.windows.net\xyz")
Run Code Online (Sandbox Code Playgroud)
当有 2000 个文件时,大约需要一分钟。
如果我们使用 CloudStorageAccount 执行相同操作:
CloudFileClient fileClient = storageAccount.CreateCloudFileClient();
CloudFileDirectory directory = fileClient.GetShareReference("account").GetRootDirectoryReference().GetDirectoryReference("abc");
Int64 totalLength = 0;
foreach (IListFileItem fileAndDirectory in directory.ListFilesAndDirectories())
{
CloudFile file = (CloudFile)fileAndDirectory;
if (file == null) //must be directory if null
continue;
totalLength += file.Properties.Length;
}
Run Code Online (Sandbox Code Playgroud)
它会返回所有文件,但大约需要 10 秒。为什么性能会有如此大的差异?
Mac OS X El Capitan(版本10.11.5)想要连接到服务器以访问一些共享图像。
Finder -> Go -> Connect to Server,然后输入地址
smb://172.16.X.X/
Run Code Online (Sandbox Code Playgroud)
然后下一步输入用户名和密码,然后就会提示
Check the server name or IP address, and then try again. If you continue to have problems, contact your system administrator.
Run Code Online (Sandbox Code Playgroud)
但是我的同事都可以连接成功,只有我自己连接不上。
中的错误消息Console是
6/16/16 21:14:24.000 kernel[0]: smb_ntstatus_error_to_errno: Couldn't map ntstatus (0xc000019c) to errno returning EIO
6/16/16 21:14:25.000 kernel[0]: smb_ntstatus_error_to_errno: Couldn't map ntstatus (0xc000019c) to errno returning EIO
6/16/16 21:14:26.000 kernel[0]: smb_ntstatus_error_to_errno: Couldn't map ntstatus (0xc000019c) to errno returning EIO
6/16/16 21:14:26.465 NetAuthSysAgent[1218]: checkForDfsReferral: …Run Code Online (Sandbox Code Playgroud) 我正在尝试从 Windows 共享文件夹中获取一些文件,在 Ubuntu 操作系统上运行 python3.5。由于 urllib2 在 python3 上不可用,我有这个简单的代码:
目录 = 'smb://user:passw@xxx.xxx.x.xx/shared_folder/' 对于符号中的符号:
path = dir+symbol+'.csv'
director = urllib.request.build_opener(SMBHandler)
fh = director.open(path)
# ..... do some stuff
fh.close()
Run Code Online (Sandbox Code Playgroud)
符号是当前存在的n个文件的列表。该代码适用于符号中的前 2 个元素,但由于某种原因,在 2 个循环之后我收到此错误
Traceback (most recent call last):
File "/home/shock/anaconda3/envs/tensorflow/lib/python3.5/site-packages/smb/SMBHandler.py", line 70, in smb_open
file_attrs, retrlen = conn.retrieveFile(service, path, fp)
File "/home/shock/anaconda3/envs/tensorflow/lib/python3.5/site-packages/smb/SMBConnection.py", line 267, in retrieveFile
return self.retrieveFileFromOffset(service_name, path, file_obj, 0, -1, timeout)
File "/home/shock/anaconda3/envs/tensorflow/lib/python3.5/site-packages/smb/SMBConnection.py", line 299, in retrieveFileFromOffset
self._pollForNetBIOSPacket(timeout)
File "/home/shock/anaconda3/envs/tensorflow/lib/python3.5/site-packages/smb/SMBConnection.py", line 583, in _pollForNetBIOSPacket
self.feedData(data)
File "/home/shock/anaconda3/envs/tensorflow/lib/python3.5/site-packages/nmb/base.py", …Run Code Online (Sandbox Code Playgroud) smb ×10
shell ×2
windows ×2
azure ×1
azure-files ×1
bash ×1
c# ×1
cifs ×1
database ×1
escaping ×1
file ×1
file-copying ×1
java ×1
jcifs ×1
macos ×1
mount ×1
performance ×1
postgresql ×1
python-3.x ×1
react-native ×1
ubuntu ×1
unix ×1
urllib ×1
vagrant ×1