nish projects wrote:I just want to know if we can get to know how much free space is left on the remote machine
nish projects wrote:I would be using the simple java IO calls through a windows based system. Would the getfreespace method works for the network drives too?
nish projects wrote:Hi Jeff,
All the system in the network are windows based..
Jeff Verdegan wrote:
nish projects wrote:Hi Jeff,
All the system in the network are windows based..
Then probably ssh + df is not an option for you, although I assume Windows has an equivalent command. (You'd still need an ssh server running though too.)
nish projects wrote:
Ok. Is there any other way to do it.
My requirement is to check for the disk space on the remote machine which is windows based and for which the IP has been provided,
provided there will be no ssh installed or drive mapping.
Jeff Verdegan wrote:The java.io classes that deal with files only work on the local file system.
Rob Spoor wrote:
Jeff Verdegan wrote:The java.io classes that deal with files only work on the local file system.
Not completely true. java.io.File can handle network shares as long as a) the local system is Windows, b) the share is a Windows share, and c) the user running the Java code has access to the share.
Rob Spoor wrote:
Jeff Verdegan wrote:The java.io classes that deal with files only work on the local file system.
Not completely true. java.io.File can handle network shares as long as a) the local system is Windows, b) the share is a Windows share, and c) the user running the Java code has access to the share.
Koen Aerts wrote:
Rob Spoor wrote:
Jeff Verdegan wrote:The java.io classes that deal with files only work on the local file system.
Not completely true. java.io.File can handle network shares as long as a) the local system is Windows, b) the share is a Windows share, and c) the user running the Java code has access to the share.
Local system doesn't need to be Windows. I've used File on a UNIX systems with mount point (using Sharity Light) to a Windows share.
Jeff Verdegan wrote:
Koen Aerts wrote:
Rob Spoor wrote:
Jeff Verdegan wrote:The java.io classes that deal with files only work on the local file system.
Not completely true. java.io.File can handle network shares as long as a) the local system is Windows, b) the share is a Windows share, and c) the user running the Java code has access to the share.
Local system doesn't need to be Windows. I've used File on a UNIX systems with mount point (using Sharity Light) to a Windows share.
Yeah, but is is mounted so that it's visible as a local file system, such as /mnt/my_windows_drive? Or were you specifying the remote host in the File object?
Koen Aerts wrote:
The share would have to be mounted so that it looks like it's local.
But - and I might be wrong here - it is the share that determines what you can do with java.io.File.
Jeff Verdegan wrote:
Rob Spoor wrote:
Jeff Verdegan wrote:The java.io classes that deal with files only work on the local file system.
Not completely true. java.io.File can handle network shares as long as a) the local system is Windows, b) the share is a Windows share, and c) the user running the Java code has access to the share.
Are you saying java.io.File can parse UNC paths, e.g. \\10.0.0.1\some_share, as opposed to having to explicitly map it through Windows first? If so, that must be relatively new (like since 1.5 or something). I know it didn't used to be able to do that.
Rob Spoor wrote:
Jeff Verdegan wrote:
Rob Spoor wrote:
Jeff Verdegan wrote:The java.io classes that deal with files only work on the local file system.
Not completely true. java.io.File can handle network shares as long as a) the local system is Windows, b) the share is a Windows share, and c) the user running the Java code has access to the share.
Are you saying java.io.File can parse UNC paths, e.g. \\10.0.0.1\some_share, as opposed to having to explicitly map it through Windows first? If so, that must be relatively new (like since 1.5 or something). I know it didn't used to be able to do that.
I don't know since when it's possible, but now it certainly is. Of course you need to escape the \\ to \\\\, but it still works.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |