You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: basic/basic18.html
+54-2Lines changed: 54 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -187,16 +187,68 @@ <h5>ما البروتوكول protocol المستخدم للمسار المطل
187
187
188
188
189
189
190
-
</div>
190
+
</div>
191
191
192
192
193
193
</section>
194
194
195
195
<sectionid="3">
196
196
<h3>ج. ما الفرق بين الخطوط المائلة Slashes، والنقطة المفردة Single Dot، والنقطة المزدوجة Double Dot في بناء جملة المسار Path Syntax ؟</h3>
197
197
198
+
<p>ربما سبق لك أن رأيت روابط مثل <codeclass="br">public/logo.png/</code>، أو <codeclass="br">script.js/.</code>، أو <codeclass="br">styles.css/..</code>. ولكن ماذا تعني هذه الأنواع الخاصة <em>special types</em> من الروابط؟ تُسمى مسارات الملفات <em>file paths</em> . هناك ثلاثة قواعد أساسية يجب معرفتها. أولها الشرطة المائلة <strong>The slash</strong> ، والتي يمكن أن تكون شرطة مائلة للخلف Backslash (<codeclass="br">\</code>) أو شرطة مائلة للأمام Forward slash (<codeclass="br">/</code>) حسب نظام التشغيل. ثانيها النقطة المفردة <strong>The single dot</strong> (<codeclass="br">.</code>). وأخيرًا، لدينا النقطتان <strong>The double dot</strong> (<codeclass="br">..</code>).</p>
199
+
<p>تُعرف الشرطة المائلة <strong>The slash</strong> باسم "فاصل المسار" <em>path separator</em>. تُستخدم للإشارة إلى فاصل في النص بين أسماء المجلدات أو الملفات. بهذه الطريقة، يعرف جهاز الكمبيوتر أن <codeclass="br">/naomis-files</code> يُشير إلى مجلد <em>directory</em> يحمل الاسم نفسه، بينما يُشير <codeclass="br">/naomis/files</code> إلى مجلد ملفات في مجلد <codeclass="br">naomis</code>.</p>
200
+
<p>تشير نقطة واحدة <strong>A single dot</strong> إلى المجلد الحالي <em>the current directory</em>، ونقطتان <strong>Two dots</strong> إلى المجلد الرئيسي <em>the parent directory</em>. عادةً ما تُستخدم نقطة واحدة لضمان تمييز المسار كمسار نسبي <em>relative path</em>. تذكر أنك تعلمت في درس سابق عن المسارات النسبية Relative paths مقابل <em>versus</em> المسارات المطلقة Absolute paths.</p>
201
+
<p>مع ذلك، يُعد استخدام النقطتين <strong>Double dots</strong> أكثر شيوعًا <em>common</em> للوصول إلى الملفات خارج <em>outside</em> مجلد العمل الحالي <em>the current working directory</em>.</p>
202
+
203
+
<h4>على سبيل المثال، بالنظر إلى شجرة الملفات file tree التالية:</h4>
204
+
205
+
<divclass="sourcecode">
206
+
<pre><code>
207
+
my-app/
208
+
├─ public/
209
+
│ ├─ favicon.ico
210
+
│ ├─ index.html
211
+
├─ src/
212
+
│ ├─ index.css
213
+
│ ├─ index.js
214
+
</code></pre>
215
+
</div>
216
+
<p>إذا كان ملف <codeclass="br">public/index.html</code> يتطلب تحميل ملف <codeclass="br">favicon.ico</code>، فاستخدم مسارًا نسبيًا <em>relative path</em> بنقطة واحدة a single dot للوصول إلى المجلد الحالي <em>the current directory</em>: <codeclass="br">favicon.ico/.</code>. أما إذا كان ملف <codeclass="br">public/index.html</code> يتطلب تحميل ملف <codeclass="br">index.css</code>، فاستخدم مسارًا نسبيًا <em>relative path</em> بنقطتين double dots للانتقال إلى مجلد <codeclass="br">my-app</code> الرئيسي أولًا، ثم إلى مجلد <codeclass="br">src</code>، وأخيرًا إلى ملفك: <codeclass="br">src/index.css/..</code>.</p>
0 commit comments