Skip to content

Commit cc2d9ee

Browse files
author
AnalogMan151
authored
Fixed issue with checking space given relative path
1 parent 9af29b0 commit cc2d9ee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

splitNSP.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python3
22
# Author: AnalogMan
3-
# Modified Date: 2018-10-07
3+
# Modified Date: 2018-10-08
44
# Purpose: Splits Nintendo Switch NSP files into parts for installation on FAT32
55

66
import os
@@ -14,7 +14,7 @@
1414

1515
def splitQuick(filepath):
1616
fileSize = os.path.getsize(filepath)
17-
info = shutil.disk_usage(os.path.dirname(filepath))
17+
info = shutil.disk_usage(os.path.dirname(os.path.abspath(filepath)))
1818
if info.free < splitSize:
1919
print('Not enough temporary space. Needs 4GiB of free space\n')
2020
return
@@ -76,7 +76,7 @@ def splitQuick(filepath):
7676

7777
def splitCopy(filepath):
7878
fileSize = os.path.getsize(filepath)
79-
info = shutil.disk_usage(os.path.dirname(filepath))
79+
info = shutil.disk_usage(os.path.dirname(os.path.abspath(filepath)))
8080
if info.free < fileSize*2:
8181
print('Not enough free space to run. Will require twice the space as the NSP file\n')
8282
return

0 commit comments

Comments
 (0)