suizokukan / katal

select a bunch of files, create a catalogue of the selected files without duplicates and tag them
GNU General Public License v3.0
8 stars 1 forks source link

improve test_is_ntfs_prefix_mandatory() #38

Closed suizokukan closed 8 years ago

suizokukan commented 8 years ago

///////////////////////////////////////////////////////////////////////////////

def test_is_ntfs_prefix_mandatory(_path): """ test_is_ntfs_prefix_mandatory


    Return True if the _path is a path in a systemfile requiring the NTFS
    prefix for long filenames.
    ________________________________________________________________________

    PARAMETER
        _path : (str)the path to be tested

    RETURNED VALUE
        a boolean
"""
longpath = os.path.join(_path, "a"*250, "b"*250)
res = False

try:
    os.mkdir(longpath)
except IOError:
    res = True

if res is False:
    os.rmdir(longpath)

return res
suizokukan commented 8 years ago
longpath = os.path.normpath(os.path.abspath(os.path.expanduser(os.path.join(_path, "a"*250, "b"*250))))
res = False
try:
    os.mkdir(longpath)
except IOError:
    res = True

if res is False:
    os.rmdir(longpath)

return res
suizokukan commented 8 years ago

done : see version 0.2.1