Note that there are some explanatory texts on larger screens.

plurals
  1. PODisk space on Windows share over SMB from Linux
    primarykey
    data
    text
    <p>I'm developing an addon for <a href="http://www.xbmc.org" rel="nofollow">XBMC</a> that checks for files to delete based upon disk space availability. I am having trouble checking for disk space on my Windows 7 share from Linux-based operating systems, including Raspberry Pi, Ubuntu, etc. XBMC uses python 2.6 by the way.</p> <p>My current code is as follows:</p> <pre><code>import os loc1 = "smb://geert/e/Downloads/" loc2 = "/home/" stats = os.statvfs(loc) print stats </code></pre> <p>In the code above <code>loc1</code> is the path that gives trouble. It appears as if the <code>statvfs</code> module cannot handle <code>smb://</code> paths, because I keep getting the error below. When I try <code>loc2</code> everything is fine. I have searched high and low for a definitive answer to this question, but could not find any.</p> <pre><code>/usr/bin/python2.7 statvfstest.py Traceback (most recent call last): File "statvfstest.py", line 8, in &lt;module&gt; print os.statvfs(loc) OSError: [Errno 2] No such file or directory: 'smb://geert/e/Downloads/' </code></pre> <p><strong>Steps I have tried:</strong></p> <ul> <li><p>I have tried the <code>psutil</code> module as I have seen recommended frequently in other questions on this site, but it appears to merely be a wrapper for the <code>statvfs</code> method and thus results in the same error message, only with a longer stack trace.</p></li> <li><p>Mounted the <code>e</code> share and used the proper credentials. The share is visible from the file manager and shows the correct contents.</p></li> <li><p>I have added credentials to <code>loc1</code> in the form <code>smb://user:pass@geert/e/Downloads/</code>.</p></li> <li><p>Any combination of the above three methods, all to no avail.</p></li> </ul> <p>Could you please help me reliably test the amount of free space available on my Windows share, from a Linux PC, using smb network paths? If at all possible I would like to refrain from adding extra modules to my addon just for this feature, to ensure it stays lightweight. </p> <p>Thanks in advance,</p> <p>Geert</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload