Modul node:path
_ menyediakan utilitas untuk bekerja dengan jalur file dan direktori. Itu dapat diakses menggunakan
const path = require['node:path'];
Windows vs. POSIX
Operasi default modul node:path
bervariasi berdasarkan sistem operasi di mana Node. aplikasi js sedang berjalan. Khususnya, saat dijalankan pada sistem operasi Windows, modul node:path
akan menganggap bahwa jalur gaya Windows sedang digunakan
Jadi menggunakan path.basename[]
mungkin menghasilkan hasil yang berbeda pada POSIX dan Windows
Di POSIX
Di Windows
Untuk mencapai hasil yang konsisten saat bekerja dengan jalur file Windows di sistem operasi apa pun, gunakan
Di POSIX dan Windows
Untuk mencapai hasil yang konsisten saat bekerja dengan jalur file POSIX di sistem operasi apa pun, gunakan
Di POSIX dan Windows
Di Node Windows. js mengikuti konsep direktori kerja per-drive. Perilaku ini dapat diamati saat menggunakan jalur drive tanpa garis miring terbalik. Misalnya, path.resolve['C:\\']
berpotensi mengembalikan hasil yang berbeda dari
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
0. Untuk informasi lebih lanjut, lihat┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
_1
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
HistoryVersionChangesv6. 0. 0
Melewati non-string sebagai argumen
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
2 akan dilontarkan sekarangv0. 1. 25Ditambahkan. v0. 1. 25
Metode path.basename[]
mengembalikan bagian terakhir dari
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
2, mirip dengan perintah Unix ┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
5. Trailing diabaikanMeskipun Windows biasanya memperlakukan nama file, termasuk ekstensi file, dengan cara yang tidak peka huruf besar-kecil, fungsi ini tidak. Misalnya,
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
6 dan ┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
7 merujuk ke file yang sama, tetapi ┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
5 memperlakukan ekstensi sebagai string peka huruf besar-kecilA dilemparkan jika
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
_2 bukan string atau jika ┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" C:\ path\dir \ file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
1 diberikan dan bukan string┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" C:\ path\dir \ file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
_2
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" C:\ path\dir \ file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
Menyediakan pembatas jalur khusus platform
Misalnya, pada POSIX
Di Windows
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" C:\ path\dir \ file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
_3
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" C:\ path\dir \ file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
HistoryVersionChangesv6. 0. 0
Melewati non-string sebagai argumen
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
2 akan dilontarkan sekarangv0. 1. 16Ditambahkan. v0. 1. 16
Metode
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" C:\ path\dir \ file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
_5 mengembalikan nama direktori dari ┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
2, mirip dengan perintah Unix ┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" C:\ path\dir \ file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
7. Pemisah direktori trailing diabaikan, lihatA dilempar jika
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
2 bukan stringnode:path
_1
HistoryVersionChangesv6. 0. 0
Melewati non-string sebagai argumen
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
2 akan dilontarkan sekarangv0. 1. 25Ditambahkan. v0. 1. 25
Metode node:path
_3 mengembalikan ekstensi
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
2, dari kemunculan terakhir karakter node:path
5 [titik] hingga akhir string di bagian terakhir dari ┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
2. Jika tidak ada node:path
5 di bagian terakhir ┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
2, atau jika tidak ada node:path
5 karakter selain karakter pertama dari nama dasar ┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
2 [lihat path.basename[]
] , string kosong dikembalikanA dilempar jika
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
2 bukan stringnode:path
_4
HistoryVersionChangesv19. 0. 0
Titik akan ditambahkan jika tidak ditentukan dalam node:path
5
Ditambahkan. v0. 11. 15
node:path
6 Objek JavaScript apa pun yang memiliki properti berikut- Pengembalian.
node:path
0 diabaikan jikanode:path
1 diberikannode:path
2 dannode:path
3 diabaikan jikanode:path
4 ada
Metode node:path
_7 mengembalikan string jalur dari objek. Ini kebalikan dari
Saat memberikan properti ke node:path
_6 ingat bahwa ada kombinasi di mana satu properti memiliki prioritas di atas yang lain
Misalnya, pada POSIX
Di Windows
node:path
_5
Metode node:path
_6 menentukan apakah
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
2 adalah jalur absolutJika
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
2 yang diberikan adalah string dengan panjang nol, node:path
9 akan dikembalikanMisalnya, pada POSIX
Di Windows
A dilempar jika
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
2 bukan stringpath.basename[]
_2
Metode path.basename[]
_3 menggabungkan semua
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
2 segmen yang diberikan bersama-sama menggunakan pemisah khusus platform sebagai pembatas, lalu menormalkan jalur yang dihasilkanSegmen
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
2 panjang-nol diabaikan. Jika string jalur yang digabungkan adalah string dengan panjang nol maka path.basename[]
6 akan dikembalikan, mewakili direktori kerja saat iniA dilempar jika salah satu segmen jalur bukan string
path.basename[]
_8
Metode path.basename[]
_9 menormalkan
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
2 yang diberikan, menyelesaikan segmen path.win32
1 dan path.basename[]
6Ketika banyak, karakter pemisahan segmen jalur berurutan ditemukan [mis. g. path.win32
_3 di POSIX dan path.win32
4 atau path.win32
3 di Windows], mereka digantikan oleh satu contoh pemisah segmen jalur khusus platform [path.win32
3 di POSIX dan path.win32
4 di Windows]. Pemisah trailing dipertahankan
Jika
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
_2 adalah string dengan panjang nol, path.basename[]
6 dikembalikan, mewakili direktori kerja saat iniMisalnya, pada POSIX
Di Windows
Karena Windows mengenali banyak pemisah jalur, kedua pemisah tersebut akan digantikan oleh contoh pemisah pilihan Windows [path.win32
4]
A dilempar jika
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
2 bukan stringpath.posix
_3
Metode node:path
_8 mengembalikan objek yang propertinya mewakili elemen signifikan dari
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
2. Pemisah direktori trailing diabaikan, lihatObjek yang dikembalikan akan memiliki properti berikut
Misalnya, pada POSIX
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
_Di Windows
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" C:\ path\dir \ file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
A dilempar jika
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
2 bukan stringpath.posix
HistoryVersionChangesv15. 3. 0
Terekspos sebagai path.resolve['C:\\']
0
Ditambahkan. v0. 11. 15
Properti path.posix
menyediakan akses ke implementasi spesifik POSIX dari metode
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
2API dapat diakses melalui path.resolve['C:\\']
3 atau path.resolve['C:\\']
4
path.resolve['C:\\']
5
HistoryVersionChangesv6. 8. 0
Di Windows, garis miring utama untuk jalur UNC kini disertakan dalam nilai kembalian
v0. 5. 0Ditambahkan. v0. 5. 0
Metode path.resolve['C:\\']
_6 mengembalikan jalur relatif dari path.resolve['C:\\']
7 ke path.resolve['C:\\']
8 berdasarkan direktori kerja saat ini. Jika path.resolve['C:\\']
7 dan path.resolve['C:\\']
8 masing-masing memutuskan ke jalur yang sama [setelah memanggil
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
01 pada masing-masing], string dengan panjang nol dikembalikanJika string dengan panjang nol diteruskan sebagai path.resolve['C:\\']
7 atau path.resolve['C:\\']
8, direktori kerja saat ini akan digunakan sebagai pengganti string dengan panjang nol
Misalnya, pada POSIX
Di Windows
A dilemparkan jika path.resolve['C:\\']
_7 atau path.resolve['C:\\']
8 bukan string
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
_07
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
Metode
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
01 menyelesaikan urutan jalur atau segmen jalur menjadi jalur absolutUrutan jalur yang diberikan diproses dari kanan ke kiri, dengan masing-masing
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
2 berikutnya ditambahkan sampai jalur absolut dibangun. Misalnya, mengingat urutan segmen jalur. ┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
_10, ┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
11, ┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
12, memanggil ┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
13 akan mengembalikan ┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
14 karena ┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
15 bukan jalur absolut tetapi ┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
16 adalahJika, setelah memproses semua
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
_2 segmen, jalur absolut belum dibuat, direktori kerja saat ini digunakanJalur yang dihasilkan dinormalisasi dan garis miring yang tertinggal dihapus kecuali jalur diselesaikan ke direktori root
Segmen
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
2 panjang-nol diabaikanJika tidak ada
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
2 segmen yang dilewati, ┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
01 akan mengembalikan jalur absolut dari direktori kerja saat iniA dilemparkan jika salah satu argumen bukan string
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" C:\ path\dir \ file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
_8
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" C:\ path\dir \ file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
Menyediakan pemisah segmen jalur khusus platform
Misalnya, pada POSIX
Di Windows
Di Windows, garis miring ke depan [path.win32
3] dan garis miring ke belakang [path.win32
4] diterima sebagai pemisah segmen jalur;
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
_27
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
Hanya pada sistem Windows, menampilkan yang setara untuk
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
2 yang diberikan. Jika ┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
_2 bukan string, ┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
2 akan dikembalikan tanpa modifikasiMetode ini bermakna hanya pada sistem Windows. Pada sistem POSIX, metode ini non-operasional dan selalu mengembalikan
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
2 tanpa modifikasipath.win32
HistoryVersionChangesv15. 3. 0
Terekspos sebagai
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
_33v0. 11. 15Ditambahkan. v0. 11. 15
Properti path.win32
menyediakan akses ke implementasi khusus Windows dari metode
┌─────────────────────┬────────────┐
│ dir │ base │
├──────┬ ├──────┬─────┤
│ root │ │ name │ ext │
" / home/user/dir / file .txt "
└──────┴──────────────┴──────┴─────┘
[All spaces in the "" line should be ignored. They are purely for formatting.]
2