2
I found some modulus functions os
and its sub-product path
I don’t see what they can do:
- islink
- ismount
There may be links in the file system?
2
I found some modulus functions os
and its sub-product path
I don’t see what they can do:
There may be links in the file system?
4
They can. Links (hard or symbolic) appear in most operating systems and file systems.
mklink
, in older versions (XP or lower) you can do this with the command junction
. Similarly, most operating systems allow you to mount partitions (see command mount
linux).
The methods islink
and ismount
module the path. verify if a given path represents a symbolic link or a mounted partition.
2
islink
says if the specified path is a symbolic link (Symbolic link, soft link or symlink). Formerly this type of path only existed on *NIX systems, but recent versions of Windows also support them. Roughly speaking, they function as a "nickname": if a file is in /caminho/pro/arquivo
and there is a symbolic link /meu/link
associated with /caminho
then you can get to the same file through /meu/link/pro/arquivo
.
(Besides the symbolic links there are also hard links - which work in a similar way but have a different internal representation. I suggest opening a specific question if you want to know more about these link types)
Already ismount
says if the specified path is a point of assembly. An example in Windows would be C:\
(or D:\
, etc). In *NIX, a path is an assembly point if the "parent" path is on a device other than the child path. Ex.: in /media/cdrom/arquivo
the file is on the CD, but the path /media
is in the OR itself, so /media/cdrom
is an assembly point.
Browser other questions tagged python-3.x
You are not signed in. Login or sign up in order to post.