Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3855434
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:46:32+00:00 2026-05-19T17:46:32+00:00

I’m writing a source control application. Now I want to copy the files from

  • 0

I’m writing a source control application. Now I want to copy the files from one machine to another machine over the network using BSD sockets. I also want to NOT follow symbolic links, but to copy the link itself to the other machine. I am a liitle bit stuck on this one.

One option I thought about was using the readlink() command, sending the data to the other side of the machine and writing the received contents to a file. I don’t even know if that’s going to work, because I don’t know wether different operating systems (Ubuntu and Mac OS X in my case) have the same file structure in symbolic links. And I don’t even know if writing those received contents to a file will automatically make it a symbolic link. Honestly I hardly doubt that. Maybe the open() command with the O_SYMLINK flag will work to create a symbolic link and write to it?

An other option I thought about was to let the other machine know we are handling a link and make that link on that machine with symlink(), but here I have two problems. First of all, how do I get the absolute filename the symbolic link points to on the file system. And a second problem is that I don’t know if calling symlink() with a non-existing file will work?

I’d appreciate it if someone could explain this,
ief2

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T17:46:33+00:00Added an answer on May 19, 2026 at 5:46 pm

    You should use readlink on the source system, and symlink on the destination system. symlinks don’t really have a “file structure in symbolic links”; the symlink just contains a file path (either absolute or relative).

    You should copy the symlink as-is, ie. not attempt to adjust it to the target system. It is perfectly fine to have symlinks where the target file does not exist (they are called “broken symlinks”). Users will have to set links that make sense (which might be absolute, but typically will be relative); if they don’t, things fail in a predictable way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bunch of posts stored in text files formatted in yaml/textile (from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I want to count how many characters a certain string has in PHP, but
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm making a simple page using Google Maps API 3. My first. One marker
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.