drive

PHP is_dir() returns false on Windows network drive

半世苍凉 提交于 2019-12-19 17:28:28
问题 I have a network drive mapped to drive letter X:\ going to an external hard drive with the path of "\\X-Drive\Public\Data". I am using Zend Server with Apache. My PHP command is simple $isFolder = is_dir("x:/"); echo($isFolder); //FALSE Things you should know: The code: $isFolder = is_dir("c:/"); echo($isFolder); //TRUE works as expected. I am running the Zend Apache service as an administrator user. I know this is working properly because in Task Manager the httpd.exe process shows the

New-PsDrive Remote copy from DFS share errors: A specified logon session does not exist

社会主义新天地 提交于 2019-12-19 10:15:10
问题 So to recap the situation: I am at one computer trying to run powershell using enter-pssession computername , then from the remote session, run the logic below: $DFSPath = "\\DFSpath.com" $RDL1 = [char](1+[char](gdr ?)[-1].name) New-PSDrive -Name $RDL1 -PSProvider FileSystem -Root $DFSPath -Persist -credential domain\UN The get-variable shows the variables properly. But when I try to create with New-PSDrive , it gives: New-PSDrive : A specified logon session does not exist. It may already

Is there a way to create a zip file from multiple files on google drive with the API?

我们两清 提交于 2019-12-19 09:19:37
问题 The Google Drive web interface allows you to download a single .zip file if you download a directory. However, I find no way to do that with the API. Is it possible to create a multi file zip on drive with the API? Update: Tanakie's code works! This is great! However, I'm only able to get it working in my personal account. I have two G-Suite admin accounts and I get the error: "Sorry, unable to open the file at this time. Please check the address and try again." I have confirmed this works

Detect drive mount event in c#

≡放荡痞女 提交于 2019-12-18 16:09:32
问题 How to catch an event when a new drive is added to My Computer and preferably and when new mount point for some drive is created on a NTFS drive? I figued out this but it doesn't work on mounted folders: _eventWatcher = new ManagementEventWatcher("SELECT * FROM Win32_VolumeChangeEvent"); _eventWatcher.EventArrived += (o, args) => {switch(args.NewEvent["EventType"].ToString()[0]) { case '2': //mount Debug.WriteLine(args.NewEvent["DriveName"]); break; case '3': //unmount break; } };

Detect drive mount event in c#

萝らか妹 提交于 2019-12-18 16:09:01
问题 How to catch an event when a new drive is added to My Computer and preferably and when new mount point for some drive is created on a NTFS drive? I figued out this but it doesn't work on mounted folders: _eventWatcher = new ManagementEventWatcher("SELECT * FROM Win32_VolumeChangeEvent"); _eventWatcher.EventArrived += (o, args) => {switch(args.NewEvent["EventType"].ToString()[0]) { case '2': //mount Debug.WriteLine(args.NewEvent["DriveName"]); break; case '3': //unmount break; } };

How to copy files to network path or drive using Python

穿精又带淫゛_ 提交于 2019-12-18 04:16:27
问题 Mine is similar to this question. How to copy a file from a network share to local disk with variables? The only difference is my network drive has a password protect with username and password. I need to copy files to a Samba share using Python and verify it. If I manually login in then the code works, but without logging in the shutil command does not work. 回答1: I'd try mapping the share to an unused drive letter by calling the NET USE command using os.system (assuming you are on Windows):

Combine `Get-Disk` info and `LogicalDisk` info in PowerShell?

廉价感情. 提交于 2019-12-17 09:45:41
问题 I have this query which scans all logical disks information : Write-Host "Drive information for $env:ComputerName" Get-WmiObject -Class Win32_LogicalDisk | Where-Object {$_.DriveType -ne 5} | Sort-Object -Property Name | Select-Object Name, VolumeName, VolumeSerialNumber,SerialNumber, FileSystem, Description, VolumeDirty, ` @{"Label"="DiskSize(GB)";"Expression"={"{0:N}" -f ($_.Size/1GB) -as [float]}}, ` @{"Label"="FreeSpace(GB)";"Expression"={"{0:N}" -f ($_.FreeSpace/1GB) -as [float]}}, ` @{

How to access specific raw data on disk from java

若如初见. 提交于 2019-12-17 05:59:07
问题 I'm trying to use the following code to access one byte with offset of 50 bytes in a raw disk. randomAccessFile = new RandomAccessFile("C:", "r"); randomAccessFile.seek(50); byte[] buffer = new byte[1]; randomAccessFile.read(buffer); But all what I get is the following error: java.io.FileNotFoundException: C: (Acceso denegado) at java.io.RandomAccessFile.open(Native Method) at java.io.RandomAccessFile.<init>(RandomAccessFile.java:212) at java.io.RandomAccessFile.<init>(RandomAccessFile.java

How to access specific raw data on disk from java

心不动则不痛 提交于 2019-12-17 05:57:30
问题 I'm trying to use the following code to access one byte with offset of 50 bytes in a raw disk. randomAccessFile = new RandomAccessFile("C:", "r"); randomAccessFile.seek(50); byte[] buffer = new byte[1]; randomAccessFile.read(buffer); But all what I get is the following error: java.io.FileNotFoundException: C: (Acceso denegado) at java.io.RandomAccessFile.open(Native Method) at java.io.RandomAccessFile.<init>(RandomAccessFile.java:212) at java.io.RandomAccessFile.<init>(RandomAccessFile.java

How to format drive in FAT 16 format using VB.NET without user interaction

走远了吗. 提交于 2019-12-14 03:51:13
问题 How to format drive in FAT 16 format using VB.NET without user interaction 回答1: That would be the VB.NET translation of this C# answer to a similar question : Dim allDrives As DriveInfo() = DriveInfo.GetDrives() For Each d As DriveInfo In allDrives If d.IsReady AndAlso (d.DriveType = DriveType.Removable) Then Dim startInfo As New ProcessStartInfo() startInfo.FileName = "format.com" startInfo.Arguments = "/fs:FAT /v:MyVolume /q " & d.Name.Remove(2) startInfo.UseShellExecute = False startInfo