What is the function of the ismount method

Asked

Viewed 57 times

2

I found some modulus functions os and its sub-product path I don’t see what they can do:

  1. islink
  2. ismount

There may be links in the file system?

2 answers

4

They can. Links (hard or symbolic) appear in most operating systems and file systems.

  • On Linux you can create a link with the command ln.
  • In modern versions of Windows you create a link with the command 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

You are not signed in. Login or sign up in order to post.