Skip to main content

File and path manager package

Project description

fileUts

Installation

pip install fileUts

Usages


isDir

from fileUts import isDir

add1 = "c:/mydir"
add2 = "c:/mydir/myfile.ext"

print(isDir(add1))
print(isDir(add2))
True
False

isFile

from fileUts import isFile

add1 = "c:/mydir"
add2 = "c:/mydir/myfile.ext"

print(isFile(add1))
print(isFile(add2))
False
True

fileExists

Raise: <InvalidFile>

from fileUts import fileExists

add1 = "c:/mydir/myfile.ext"
add2 = "c:/mydir"

print(fileExists(add1))
print(fileExists(add2)) # raises a <InvalidFile>
True

dirExists

Raise: <InvalidDir>

from fileUts import dirExists

add1 = "c:/mydir/myfile.ext"
add2 = "c:/mydir"

print(dirExists(add1)) # raises a <InvalidDir>
print(dirExists(add2))
True

getFileExtenssion

Raise: <InvalidFile>

from fileUts import getFileExtenssion

add1 = "c:/mydir/myfile.ext"
add2 = "c:/mydir"

print(getFileExtenssion(add1))
print(getFileExtenssion(add2)) # raises a <InvalidFile>
'ext'

createDir

Raise: <InvalidDir>

from fileUts import createDir

add1 = "c:/mydir/myfile.ext"
add2 = "c:/mydir"

print(createDir(add1)) # raises a <InvalidDir>
print(createDir(add2))
True

createDir

Raise: <InvalidDir>

from fileUts import createDir

add1 = "c:/mydir/myfile.ext"
add2 = "c:/mydir/mydir2/mydir3"

print(createDir(add1)) # raises a <InvalidDir>
print(createDir(add2))
True

moveFiles

Raise: <InvalidDir>

from fileUts import moveFiles

files   = "c:/mydir/myfile.*"
to_addr = "c:/target_dir"

print(moveFiles(files,to_addr))
1

clearDir

Raise: <InvalidDir>

from fileUts import clearDir

add1 = "c:/mydir/myfile.ext"
add2 = "c:/mydir" 

clearDir(add1) # raises a <InvalidDir>
clearDir(add2)

renameFile

Raise: <InvalidDir>

from fileUts import renameFile

add1 = "c:/mydir/myfile.ext"
add2 = "c:/mydir" 

renameFile(add1,'newname.ext')
renameFile(add2,,'newname.ext') # raises a <InvalidFile>

Change Log

0.0.1 (2022-10-30)

  • First Release

0.0.2 (2022-10-30)

  • Raise Fixed

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fileUts-0.0.2.tar.gz (4.0 kB view details)

Uploaded Source

File details

Details for the file fileUts-0.0.2.tar.gz.

File metadata

  • Download URL: fileUts-0.0.2.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.0

File hashes

Hashes for fileUts-0.0.2.tar.gz
Algorithm Hash digest
SHA256 568a2e51f06d56183b6a8dcd122f992892d3ce55157dc7a8fbd63b0843bd84d5
MD5 a77539bbe7278dbff3d36c305a44634a
BLAKE2b-256 aca816368bdc929a8c26aa5322d0076d9ee37ecca7e11180dc24abcb6493c1d6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page