Skip to content

Commit 6c216d3

Browse files
authored
Merge pull request #33 from d3j1x/main
ج. ما الفرق بين الخطوط المائلة Slashes، والنقطة المفردة Single Dot، و…
2 parents 36f2def + 581ff8e commit 6c216d3

1 file changed

Lines changed: 54 additions & 2 deletions

File tree

basic/basic18.html

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,16 +187,68 @@ <h5>ما البروتوكول protocol المستخدم للمسار المطل
187187

188188

189189

190-
</div>
190+
</div>
191191

192192

193193
</section>
194194

195195
<section id="3">
196196
<h3>ج. ما الفرق بين الخطوط المائلة Slashes، والنقطة المفردة Single Dot، والنقطة المزدوجة Double Dot في بناء جملة المسار Path Syntax ؟</h3>
197197

198+
<p>ربما سبق لك أن رأيت روابط مثل <code class="br">public/logo.png/</code>، أو <code class="br">script.js/.</code>، أو <code class="br">styles.css/..</code>. ولكن ماذا تعني هذه الأنواع الخاصة <em>special types</em> من الروابط؟ تُسمى مسارات الملفات <em>file paths</em> . هناك ثلاثة قواعد أساسية يجب معرفتها. أولها الشرطة المائلة <strong>The slash</strong> ، والتي يمكن أن تكون شرطة مائلة للخلف Backslash (<code class="br">\</code>) أو شرطة مائلة للأمام Forward slash (<code class="br">/</code>) حسب نظام التشغيل. ثانيها النقطة المفردة <strong>The single dot</strong> (<code class="br">.</code>). وأخيرًا، لدينا النقطتان <strong>The double dot</strong> (<code class="br">..</code>).</p>
199+
<p>تُعرف الشرطة المائلة <strong>The slash</strong> باسم "فاصل المسار" <em>path separator</em>. تُستخدم للإشارة إلى فاصل في النص بين أسماء المجلدات أو الملفات. بهذه الطريقة، يعرف جهاز الكمبيوتر أن <code class="br">/naomis-files</code> يُشير إلى مجلد <em>directory</em> يحمل الاسم نفسه، بينما يُشير <code class="br">/naomis/files</code> إلى مجلد ملفات في مجلد <code class="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+
<div class="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>إذا كان ملف <code class="br">public/index.html</code> يتطلب تحميل ملف <code class="br">favicon.ico</code>، فاستخدم مسارًا نسبيًا <em>relative path</em> بنقطة واحدة a single dot للوصول إلى المجلد الحالي <em>the current directory</em>: <code class="br">favicon.ico/.</code>. أما إذا كان ملف <code class="br">public/index.html</code> يتطلب تحميل ملف <code class="br">index.css</code>، فاستخدم مسارًا نسبيًا <em>relative path</em> بنقطتين double dots للانتقال إلى مجلد <code class="br">my-app</code> الرئيسي أولًا، ثم إلى مجلد <code class="br">src</code>، وأخيرًا إلى ملفك: <code class="br">src/index.css/..</code>.</p>
217+
218+
219+
<div class="questions">
220+
221+
<h4>أسئلة :</h4>
222+
223+
<h5>أي خيار هو مسار مطلق Absolute path ؟</h5>
224+
225+
<p><mark>١. <code class="br">public/styles.css/</code></mark></p>
226+
<p>٢. <code class="br">script.js/.</code></p>
227+
<p>٣. <code class="br">src/nav.html/..</code></p>
228+
<p>٤. <code class="br">https://freecodecamp.org</code></p>
229+
230+
<br>
231+
232+
<h5>أي خيار هو مسار نسبي Relative path للمجلد الحالي to the current directory ؟</h5>
233+
<p>١. <code class="br">public/styles.css/</code></p>
234+
<p><mark>٢. <code class="br">script.js/.</code></mark></p>
235+
<p>٣. <code class="br">src/nav.html/..</code></p>
236+
<p>٤. <code class="br">https://freecodecamp.org</code></p>
237+
238+
<br>
239+
240+
<h5>أي خيار هو مسار نسبي Relative path للمجلد الرئيسي to the parent directory ؟</h5>
241+
<p>١. <code class="br">public/styles.css/</code></p>
242+
<p>٢. <code class="br">script.js/.</code></p>
243+
<p><mark>٣. <code class="br">src/nav.html/..</code></mark></p>
244+
<p>٤. <code class="br">https://freecodecamp.org</code></p>
245+
246+
247+
248+
249+
250+
</div>
198251

199-
200252
</section>
201253

202254
<section id="4">

0 commit comments

Comments
 (0)