Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
zetef4475y@electrineer no, that is for the dirent struct. I want the dd_name for the DIR struct.
actaully what i want is this.
when run the program it should accept an argument and that argument should be a path to a folder. and if you run
. /evalite .
it should output the name of the folder itself, in this case evalite.
or if i run
./evalite ..
it should output 'projects', the name of the folder. currently it outputs . and .. in those cases and I know the way to do this is accessing the variable dd_name because i used this in other projects of mine. -
zetef4475y@endor @Parzi no guys, it just doesn't want to. and i swear to god i have functional programs that worked with this. anyways, do you know how should i do this problem? i just want to output the folder name of the folder path entered as a command line argument.
example:
>pwd
>c/dev/test_folder
>./program .
>test_folder
>./program ..
>dev
i searched all of the internet and no luck. -
-
zetef4475y@electrineer https://github.com/zetef/Smedit
an older side project of mine. i used the dd_name to set the title bar text to the current folder. forgive me for the ugly code formatting and literally everything, i was just begining open source coding.
look at line 163 specifically. dir is a global DIR* structure. -
zetef4475y@electrineer yes. here is the build log if it helps:
https://pastebin.com/vWMxiTbe
and my dirent.h in my include folder from mingw:
https://pastebin.com/NWFcPDgT -
zetef4475y@electrineer omg dude. I FUCKING LOVE YOU. (no homo) YOU JUST PUT A SMILE ON MY FACE. IT FINALLY WORKED. thanks dude for helping me and staying for this long . if you ever need me contact me no problem. THAAAANKS!! I CAN BARELY HOLD MY TEARS. THIS PROBLEM WASTED HOURSSS OF MY LIFE. THANK YOUU!
-
@zetef this is probably why it says on the link I posted earlier: "You shouldn't be accessing the contents of a DIR directly."
-
zetef4475y@electrineer after a little more digging and using -v when compiling i found out it was using cygwin version, not the mingw version. i just hope my project will compile on a linux system because i currently do not have access to one yet. (i have to wait til september)
-
zetef4475y@electrineer my machine has 2gb of ram and a pentium running, so nooo.
it's just a laptop from the early '10 -
Well yeah, non-portable hacks can break at any moment. That's what happens when you access stuff directly that doesn't even have specified content.
And a live Linux distro is easy enough to boot up from USB or DVD.
Related Rants
-
xjose97x19Just saw a variable in C named like this: long time_ago; //in a galaxy far away I laughed no stop.
-
Unskipp24So this happened last night... Gf: my favorite bra is not fitting me anymore Me: get a new one ? Gf: but it ...
-
sam966911Hats off to this lady .... I would have just flipped the machine
i just want to shoot my both hands, eyes and legs.
NO I DID NOT MEAN __d_dirname!!!!
I MEANT dd_name!!
NOT d_name, but dd_name!!
i swear to god the other times it worked. WHAT THE FUCK IS WRONG? I SPENT 3 FUCKING HOURS DEBUGGING THIS SHIT!
yes i have included sys/types.h, dirent.h AND sys/stat.h AND I CAN'T DO THIS ANYMORE!!
why did you worked last time? i just wanted to implement a better library than handling all the known and unknown errors myself.
if anyone knows what is wrong, please help me, i am disperate.
rant
c++
dirent
dir